]> prime8.dev >> repos - ttyd.git/commitdiff
protocol: fix pthread_cond_wait usage
authorShuanglei Tao <tsl0922@gmail.com>
Sun, 9 Sep 2018 05:37:49 +0000 (13:37 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Sun, 9 Sep 2018 05:37:49 +0000 (13:37 +0800)
src/protocol.c

index c1a6668a6932f4ea4ed75ff5c93b80947895bd97..548c4d65a5644b674ce09d7d14cd7dcf87a2f226 100644 (file)
@@ -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));