mirror of
https://github.com/fumiama/simple-dict.git
synced 2026-06-26 23:10:25 +08:00
add some cleanup
This commit is contained in:
4
server.c
4
server.c
@@ -864,8 +864,8 @@ static void accept_client(int fd) {
|
|||||||
pthread_mutex_unlock(&timer->mc);
|
pthread_mutex_unlock(&timer->mc);
|
||||||
puts("Pick thread from pool");
|
puts("Pick thread from pool");
|
||||||
} else {
|
} else {
|
||||||
pthread_cond_init(&timer_pointer_of(p)->c, NULL);
|
pthread_cond_init(&timer->c, NULL);
|
||||||
pthread_mutex_init(&timer_pointer_of(p)->mc, NULL);
|
pthread_mutex_init(&timer->mc, NULL);
|
||||||
if (pthread_create(&timer->thread, &attr, (void *)&handle_accept, timer)) {
|
if (pthread_create(&timer->thread, &attr, (void *)&handle_accept, timer)) {
|
||||||
perror("Error creating thread");
|
perror("Error creating thread");
|
||||||
cleanup_thread(timer);
|
cleanup_thread(timer);
|
||||||
|
|||||||
Reference in New Issue
Block a user