From 6237946c3164827fe05ae1b710f5b9e84db30216 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 10:39:39 +0800 Subject: [PATCH] fix isbusy --- server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.c b/server.c index e840dbf..ab6d1e8 100644 --- a/server.c +++ b/server.c @@ -631,10 +631,12 @@ static void cleanup_thread(thread_timer_t* timer) { } close_dict(timer->index); timer->thread = 0; - timer->isbusy = 0; pthread_cond_destroy(&timer->c); pthread_mutex_destroy(&timer->mc); setdicts[timer->index].data[0] = 0; + pthread_rwlock_wrlock(&timer->mb); + timer->isbusy = 0; + pthread_rwlock_unlock(&timer->mb); puts("Finish cleaning"); }