protocol: fix pthread_cond_wait usage

This commit is contained in:
Shuanglei Tao
2018-09-09 13:37:49 +08:00
parent 8e090612d3
commit b6d160a0f6

View File

@@ -198,7 +198,7 @@ thread_run_command(void *args) {
if (FD_ISSET (pty, &des_set)) { if (FD_ISSET (pty, &des_set)) {
while (client->running) { while (client->running) {
pthread_mutex_lock(&client->mutex); pthread_mutex_lock(&client->mutex);
if (client->state == STATE_READY) { while (client->state == STATE_READY) {
pthread_cond_wait(&client->cond, &client->mutex); pthread_cond_wait(&client->cond, &client->mutex);
} }
memset(client->pty_buffer, 0, sizeof(client->pty_buffer)); memset(client->pty_buffer, 0, sizeof(client->pty_buffer));