]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit, spawns unnecessary threads.
authorHoward Chu <hyc@openldap.org>
Fri, 28 Oct 2005 10:31:21 +0000 (10:31 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 28 Oct 2005 10:31:21 +0000 (10:31 +0000)
libraries/libldap_r/tpool.c

index 9a0ed4d884e3efeed41ee14ceceaf1580038821e..affdef689a7683cace944b10a0613c839482e5c8 100644 (file)
@@ -368,8 +368,9 @@ ldap_pvt_thread_pool_submit (
                return(0);
        }
        ldap_pvt_thread_cond_signal(&pool->ltp_cond);
-       if (pool->ltp_max_count <= 0
-                       || pool->ltp_open_count < pool->ltp_max_count)
+       if (pool->ltp_open_count < pool->ltp_active_count + pool->ltp_pending_count
+               && (pool->ltp_open_count < pool->ltp_max_count ||
+                       pool->ltp_max_count <= 0 ))
        {
                pool->ltp_open_count++;
                pool->ltp_starting++;