summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-07-12 08:27:24 -0400
committerGitHub <noreply@github.com>2017-07-12 08:27:24 -0400
commit991ae35b176208e946558f97ed9ab947e832e17c (patch)
tree152b33ead5af6c1313d385571c3dc98a0e440db9 /lib/thread.c
parente88500859aa6eeb84fd8ec36d30407bc169ac2f3 (diff)
parent45082064cbc498a1f4287f411512a8183f0065d6 (diff)
Merge pull request #793 from opensourcerouting/hash-double-init
lib: init & cleanup fixes
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 4e72d4c96f..26fb46e49b 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);