From: Howard Chu Date: Fri, 28 Oct 2005 10:31:21 +0000 (+0000) Subject: Fix prev commit, spawns unnecessary threads. X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~178 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f80e9d11fa69c1ddeea59b84f6fbfe5f49a69697;p=openldap Fix prev commit, spawns unnecessary threads. --- diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index 9a0ed4d884..affdef689a 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -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++;