summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 710ecc2a09..2c87c099d5 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -564,6 +564,12 @@ thread_master_free_unused (struct thread_master *m)
void
thread_master_free (struct thread_master *m)
{
+ pthread_mutex_lock (&masters_mtx);
+ {
+ listnode_delete (masters, m);
+ }
+ pthread_mutex_unlock (&masters_mtx);
+
thread_array_free (m, m->read);
thread_array_free (m, m->write);
thread_queue_free (m, m->timer);