summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/thread.c b/lib/thread.c
index d8be32e2bd..2d37857b8a 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -554,8 +554,7 @@ void thread_master_free(struct thread_master *m)
{
listnode_delete(masters, m);
if (masters->count == 0) {
- list_free(masters);
- masters = NULL;
+ list_delete_and_null(&masters);
}
}
pthread_mutex_unlock(&masters_mtx);
@@ -567,9 +566,11 @@ void thread_master_free(struct thread_master *m)
thread_list_free(m, &m->ready);
thread_list_free(m, &m->unuse);
pthread_mutex_destroy(&m->mtx);
+ pthread_cond_destroy(&m->cancel_cond);
close(m->io_pipe[0]);
close(m->io_pipe[1]);
- list_delete(m->cancel_req);
+ list_delete_and_null(&m->cancel_req);
+ m->cancel_req = NULL;
hash_clean(m->cpu_record, cpu_record_hash_free);
hash_free(m->cpu_record);