Commit 54f7e857 authored by Mark Valence's avatar Mark Valence
Browse files

Put cond_signal loop inside of mutex'ed area to fix race bug (seen on

Digital OSF 4.0e on an Alpha?)
parent 4bfda48c
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment