Fix reconnect test failure.

This commit is contained in:
Ian Gulliver
2015-06-20 17:42:54 +00:00
parent 494a1060f9
commit e29838a58e

View File

@@ -25,6 +25,7 @@ typedef struct {
void on_connect(void *passthrough) {
test_state *state = passthrough;
assert(!pthread_mutex_lock(&state->lock));
state->disconnect_fired = false;
state->connect_fired = true;
assert(!pthread_cond_signal(&state->cond));
assert(!pthread_mutex_unlock(&state->lock));
@@ -33,6 +34,7 @@ void on_connect(void *passthrough) {
void on_disconnect(void *passthrough) {
test_state *state = passthrough;
assert(!pthread_mutex_lock(&state->lock));
state->connect_fired = false;
state->disconnect_fired = true;
assert(!pthread_cond_signal(&state->cond));
assert(!pthread_mutex_unlock(&state->lock));