From ae320e6f56e9b1244e9fc5e145cf8377ba6a2c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sat, 2 Jul 2022 11:10:18 +0800 Subject: [PATCH] fix: Segmentation fault on some OS --- server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/server.c b/server.c index e47c273..38b68b9 100644 --- a/server.c +++ b/server.c @@ -569,6 +569,7 @@ static void accept_timer(void *p) { if(is_dict_opening) touch_timer(p); time_t waitsec = time(NULL) - timer->touch; printf("Wait sec: %u, max: %u\n", (unsigned int)waitsec, MAXWAITSEC); + if(pthread_kill(thread, 0)) break; if(waitsec > MAXWAITSEC) { pthread_kill(thread, SIGQUIT); puts("Kill thread");