mirror of
https://github.com/fumiama/simple-dict.git
synced 2026-06-07 03:00:25 +08:00
fix: Segmentation fault on some OS
This commit is contained in:
1
server.c
1
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");
|
||||
|
||||
Reference in New Issue
Block a user