From 525c08ff9ed47ab06ef63cfe25fdcc32a796c439 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, 15 Oct 2022 11:36:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.c b/server.c index 248fbd3..7418973 100644 --- a/server.c +++ b/server.c @@ -576,6 +576,8 @@ static void handle_kill(int signo) { puts("Handle sigkill/sigterm"); for(int i = 0; i < THREADCNT; i++) { if(timers[i].thread) pthread_kill(timers[i].thread, SIGQUIT); + pthread_cond_destroy(&timers[i].tc); + pthread_mutex_destroy(&timers[i].tmc); if(timers[i].timerthread) pthread_kill(timers[i].timerthread, SIGQUIT); } fflush(stdout); @@ -644,6 +646,8 @@ static void handle_int(int signo) { puts("Keyboard interrupted"); for(int i = 0; i < THREADCNT; i++) { if(timers[i].thread) pthread_kill(timers[i].thread, SIGQUIT); + pthread_cond_destroy(&timers[i].tc); + pthread_mutex_destroy(&timers[i].tmc); if(timers[i].timerthread) pthread_kill(timers[i].timerthread, SIGQUIT); } fflush(stdout);