More for threadqueues

Catch threads that are finishing while pool was pausing
This commit is contained in:
Howard Chu 2015-08-21 21:19:16 +01:00
parent 79157d314f
commit c034282b14

View file

@ -971,7 +971,10 @@ ldap_int_thread_pool_wrapper (
thread_keys[keyslot].ctx = DELETED_THREAD_CTX;
ldap_pvt_thread_mutex_unlock(&ldap_pvt_thread_pool_mutex);
pq->ltp_open_count--;
if (pq->ltp_open_count < 0)
pq->ltp_open_count++;
else
pq->ltp_open_count--;
if (pq->ltp_open_count == 0) {
if (pool->ltp_finishing)
/* let pool_destroy know we're all done */