mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-29 23:14:25 +01:00
server: do not block main thread when acquiring lock
This commit is contained in:
@@ -475,8 +475,7 @@ main(int argc, char **argv) {
|
||||
if (!LIST_EMPTY(&server->clients)) {
|
||||
struct tty_client *client;
|
||||
LIST_FOREACH(client, &server->clients, list) {
|
||||
if (client->running) {
|
||||
pthread_mutex_lock(&client->mutex);
|
||||
if (client->running && pthread_mutex_trylock(&client->mutex)) {
|
||||
if (client->state != STATE_DONE)
|
||||
lws_callback_on_writable(client->wsi);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user