From: Shuanglei Tao Date: Sun, 9 Sep 2018 05:37:49 +0000 (+0800) Subject: protocol: fix pthread_cond_wait usage X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=b6d160a0f6c20e5fbbbe2003252f96e105fb2cf0;p=ttyd.git protocol: fix pthread_cond_wait usage --- 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));