]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap_r/tpool.c
More for threadqueues
[openldap] / libraries / libldap_r / tpool.c
index a7ce7cd05975add7925e0f87d8f28494377fc2d5..0759f0416dc3913d35c6bba8f3b847e53e8963f4 100644 (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 */