1
0
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:
源文雨
2022-07-02 11:10:18 +08:00
committed by GitHub
parent 1295a40afd
commit ae320e6f56

View File

@@ -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");