Fix prev commit, spawns unnecessary threads.

This commit is contained in:
Howard Chu 2005-10-28 10:31:21 +00:00
parent 970ccf9584
commit f80e9d11fa

View 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++;