Remove redundant states

The closed state is not required as a separate boolean is used to track
it.
This commit is contained in:
Markus Mäkelä
2017-06-16 01:34:27 +03:00
parent 0c8e68fd05
commit 7a98e6d050
2 changed files with 3 additions and 4 deletions

View File

@ -238,8 +238,7 @@ private:
{
IN_USE = 0x01, /**< Backend has been taken into use */
WAITING_RESULT = 0x02, /**< Waiting for a reply */
CLOSED = 0x04, /**< Backend is no longer in use */
FATAL_FAILURE = 0x08 /**< Backend references that should be dropped */
FATAL_FAILURE = 0x04 /**< Backend references that should be dropped */
};
/**

View File

@ -51,7 +51,6 @@ void Backend::close(close_type type)
clear_state(WAITING_RESULT);
}
clear_state(IN_USE);
set_state(CLOSED);
if (type == CLOSE_FATAL)
{
@ -189,6 +188,7 @@ bool Backend::connect(MXS_SESSION* session)
if ((m_dcb = dcb_connect(m_backend->server, session, m_backend->server->protocol)))
{
m_closed = false;
m_state = IN_USE;
atomic_add(&m_backend->connections, 1);
rval = true;
@ -276,7 +276,7 @@ bool Backend::is_waiting_result() const
bool Backend::is_closed() const
{
return m_state & CLOSED;
return m_closed;
}
bool Backend::has_failed() const