From: Mark Valence Date: Sun, 18 Jun 2000 05:56:17 +0000 (+0000) Subject: Put cond_signal loop inside of mutex'ed area to fix race bug (seen on X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2594 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=54f7e85770a59ae9e4f0d43dbae4269636a1f58d;p=openldap Put cond_signal loop inside of mutex'ed area to fix race bug (seen on Digital OSF 4.0e on an Alpha?) --- diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index af0c4f739d..d65dc0eeb9 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -257,7 +257,6 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending ) ? LDAP_INT_THREAD_POOL_FINISHING : LDAP_INT_THREAD_POOL_STOPPING; waiting = pool->ltp_open_count; - ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); /* broadcast could be used here, but only after * it is fixed in the NT thread implementation @@ -265,6 +264,7 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending ) while (--waiting >= 0) { ldap_pvt_thread_cond_signal(&pool->ltp_cond); } + ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); do { ldap_pvt_thread_yield();