From bd5f4c22031ad01f01f33addd9e59b7295a303d8 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:20:56 +0800 Subject: [PATCH] add some cleanup --- server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.c b/server.c index 679df2d..559b358 100644 --- a/server.c +++ b/server.c @@ -864,8 +864,8 @@ static void accept_client(int fd) { pthread_mutex_unlock(&timer->mc); puts("Pick thread from pool"); } else { - pthread_cond_init(&timer_pointer_of(p)->c, NULL); - pthread_mutex_init(&timer_pointer_of(p)->mc, NULL); + pthread_cond_init(&timer->c, NULL); + pthread_mutex_init(&timer->mc, NULL); if (pthread_create(&timer->thread, &attr, (void *)&handle_accept, timer)) { perror("Error creating thread"); cleanup_thread(timer);