mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-22 20:04:19 +01:00
protocol: fix pthread_cond_wait usage
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user