Added comments
This commit is contained in:
VilhoRaatikka
2014-09-15 10:34:42 +03:00
parent c2847c7ddb
commit c7bf6b66bf

View File

@ -1560,77 +1560,80 @@ static bool dcb_set_state_nomutex(
case DCB_STATE_ALLOC: case DCB_STATE_ALLOC:
switch (new_state) { switch (new_state) {
case DCB_STATE_POLLING: /*< for client requests */ /** fall through, for client requests */
case DCB_STATE_LISTENING: /*< for connect listeners */ case DCB_STATE_POLLING:
case DCB_STATE_DISCONNECTED: /*< for failed connections */ /** fall through, for connect listeners */
dcb->state = new_state; case DCB_STATE_LISTENING:
succp = true; /** for failed connections */
break; case DCB_STATE_DISCONNECTED:
default: dcb->state = new_state;
ss_dassert(old_state != NULL); succp = true;
break; break;
default:
ss_dassert(old_state != NULL);
break;
} }
break; break;
case DCB_STATE_POLLING: case DCB_STATE_POLLING:
switch(new_state) { switch(new_state) {
case DCB_STATE_NOPOLLING: case DCB_STATE_NOPOLLING:
dcb->state = new_state; dcb->state = new_state;
succp = true; succp = true;
break; break;
default: default:
ss_dassert(old_state != NULL); ss_dassert(old_state != NULL);
break; break;
} }
break; break;
case DCB_STATE_LISTENING: case DCB_STATE_LISTENING:
switch(new_state) { switch(new_state) {
case DCB_STATE_NOPOLLING: case DCB_STATE_NOPOLLING:
dcb->state = new_state; dcb->state = new_state;
succp = true; succp = true;
break; break;
default: default:
ss_dassert(old_state != NULL); ss_dassert(old_state != NULL);
break; break;
} }
break; break;
case DCB_STATE_NOPOLLING: case DCB_STATE_NOPOLLING:
switch (new_state) { switch (new_state) {
case DCB_STATE_ZOMBIE: case DCB_STATE_ZOMBIE: /*< fall through */
dcb->state = new_state; dcb->state = new_state;
case DCB_STATE_POLLING: /*< ok to try but state can't change */ case DCB_STATE_POLLING: /*< ok to try but state can't change */
succp = true; succp = true;
break; break;
default: default:
ss_dassert(old_state != NULL); ss_dassert(old_state != NULL);
break; break;
} }
break; break;
case DCB_STATE_ZOMBIE: case DCB_STATE_ZOMBIE:
switch (new_state) { switch (new_state) {
case DCB_STATE_DISCONNECTED: case DCB_STATE_DISCONNECTED: /*< fall through */
dcb->state = new_state; dcb->state = new_state;
case DCB_STATE_POLLING: /*< ok to try but state can't change */ case DCB_STATE_POLLING: /*< ok to try but state can't change */
succp = true; succp = true;
break; break;
default: default:
ss_dassert(old_state != NULL); ss_dassert(old_state != NULL);
break; break;
} }
break; break;
case DCB_STATE_DISCONNECTED: case DCB_STATE_DISCONNECTED:
switch (new_state) { switch (new_state) {
case DCB_STATE_FREED: case DCB_STATE_FREED:
dcb->state = new_state; dcb->state = new_state;
succp = true; succp = true;
break; break;
default: default:
ss_dassert(old_state != NULL); ss_dassert(old_state != NULL);
break; break;
} }
break; break;