Skip to content

Commit

Permalink
Cosmetic changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
niklata committed Feb 19, 2024
1 parent 0d2deb4 commit 8e2d5cd
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,16 +710,14 @@ static void* clientthread(void *data) {

static void gc_threads(void) {
if (atomic_load(&g_gc_pending)) {
{
if (pthread_mutex_lock(&g_gc_mtx)) perror("mutex_lock");
while (g_gc_list) {
struct thread *t = g_gc_list;
g_gc_list = g_gc_list->gc_next;
pthread_join(t->pt, 0);
free(t);
}
if (pthread_mutex_unlock(&g_gc_mtx)) perror("mutex_unlock");
if (pthread_mutex_lock(&g_gc_mtx)) perror("mutex_lock");
while (g_gc_list) {
struct thread *t = g_gc_list;
g_gc_list = g_gc_list->gc_next;
pthread_join(t->pt, 0);
free(t);
}
if (pthread_mutex_unlock(&g_gc_mtx)) perror("mutex_unlock");
atomic_store(&g_gc_pending, 0);
}
}
Expand Down

0 comments on commit 8e2d5cd

Please sign in to comment.