mirror of
https://github.com/fumiama/simple-dict.git
synced 2026-06-12 22:40:50 +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);
|
if(is_dict_opening) touch_timer(p);
|
||||||
time_t waitsec = time(NULL) - timer->touch;
|
time_t waitsec = time(NULL) - timer->touch;
|
||||||
printf("Wait sec: %u, max: %u\n", (unsigned int)waitsec, MAXWAITSEC);
|
printf("Wait sec: %u, max: %u\n", (unsigned int)waitsec, MAXWAITSEC);
|
||||||
|
if(pthread_kill(thread, 0)) break;
|
||||||
if(waitsec > MAXWAITSEC) {
|
if(waitsec > MAXWAITSEC) {
|
||||||
pthread_kill(thread, SIGQUIT);
|
pthread_kill(thread, SIGQUIT);
|
||||||
puts("Kill thread");
|
puts("Kill thread");
|
||||||
|
|||||||
Reference in New Issue
Block a user