From 729f74b7cf06ebd44aa8d9e3192276f47055ca13 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 1 Jun 2020 18:40:16 +0200 Subject: libfshelp: destroy condition variable before freeing it To make sure that threads have really woken up. Spotted by Richard Braun. * libfshelp/rlock-drop-peropen.c (fshelp_rlock_drop_peropen): Call pthread_cond_destroy before freeing the condition variable. * libfshelp/rlock-tweak.c (fshelp_rlock_tweak): Likewise. --- libfshelp/rlock-tweak.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libfshelp/rlock-tweak.c') diff --git a/libfshelp/rlock-tweak.c b/libfshelp/rlock-tweak.c index b0f4b9f5..8be88993 100644 --- a/libfshelp/rlock-tweak.c +++ b/libfshelp/rlock-tweak.c @@ -70,6 +70,7 @@ fshelp_rlock_tweak (struct rlock_box *box, pthread_mutex_t *mutex, if (wake_waiters && l->waiting) pthread_cond_broadcast (&l->wait); + pthread_cond_destroy(&l->wait); free (l); } -- cgit v1.2.3