protocol: replace sleep with pthread cond

This commit is contained in:
Shuanglei Tao
2018-08-20 13:33:17 +08:00
parent d1d5336af1
commit 176f3e18a3
3 changed files with 5 additions and 3 deletions

View File

@@ -475,6 +475,8 @@ main(int argc, char **argv) {
pthread_mutex_lock(&client->mutex);
if (client->state != STATE_DONE)
lws_callback_on_writable(client->wsi);
else
pthread_cond_signal(&client->cond);
pthread_mutex_unlock(&client->mutex);
}
}