1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-08 03:50:25 +08:00

add some cleanup

This commit is contained in:
源文雨
2022-10-15 11:20:56 +08:00
parent babb77d153
commit bd5f4c2203

View File

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