From b6d160a0f6c20e5fbbbe2003252f96e105fb2cf0 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Sun, 9 Sep 2018 13:37:49 +0800 Subject: [PATCH] protocol: fix pthread_cond_wait usage --- src/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol.c b/src/protocol.c index c1a6668..548c4d6 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -198,7 +198,7 @@ thread_run_command(void *args) { if (FD_ISSET (pty, &des_set)) { while (client->running) { pthread_mutex_lock(&client->mutex); - if (client->state == STATE_READY) { + while (client->state == STATE_READY) { pthread_cond_wait(&client->cond, &client->mutex); } memset(client->pty_buffer, 0, sizeof(client->pty_buffer)); -- 2.43.4