mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-16 11:57:39 -05:00
ITS#4349 don't wait on condition if there are no threads in the pool.
This commit is contained in:
parent
26cf7548ef
commit
84315e96f8
1 changed files with 4 additions and 2 deletions
|
|
@ -507,8 +507,10 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending )
|
|||
? LDAP_INT_THREAD_POOL_FINISHING
|
||||
: LDAP_INT_THREAD_POOL_STOPPING;
|
||||
|
||||
ldap_pvt_thread_cond_broadcast(&pool->ltp_cond);
|
||||
ldap_pvt_thread_cond_wait(&pool->ltp_cond, &pool->ltp_mutex);
|
||||
if ( pool->ltp_open_count ) {
|
||||
ldap_pvt_thread_cond_broadcast(&pool->ltp_cond);
|
||||
ldap_pvt_thread_cond_wait(&pool->ltp_cond, &pool->ltp_mutex);
|
||||
}
|
||||
|
||||
while ((ctx = LDAP_STAILQ_FIRST(&pool->ltp_pending_list)) != NULL)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue