From: Howard Chu Date: Mon, 31 Dec 2001 04:01:26 +0000 (+0000) Subject: Fix previous commit X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~402 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6e66d14311b9a385456f0482a42ab8a60d963ac3;p=openldap Fix previous commit --- diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index f64c3009e0..623328026b 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -119,12 +119,9 @@ ldap_pvt_thread_pool_init ( pool->ltp_state = LDAP_INT_THREAD_POOL_RUNNING; pool->ltp_max_count = max_threads; pool->ltp_max_pending = max_pending; + STAILQ_INIT(&pool->ltp_pending_list); ldap_pvt_thread_mutex_lock(&ldap_pvt_thread_pool_mutex); - if (STAILQ_EMPTY(&ldap_int_thread_pool_list)) { - STAILQ_INSERT_HEAD(&ldap_int_thread_pool_list, pool, ltp_next); - } else { - STAILQ_INSERT_TAIL(&ldap_int_thread_pool_list, pool, ltp_next); - } + STAILQ_INSERT_TAIL(&ldap_int_thread_pool_list, pool, ltp_next); ldap_pvt_thread_mutex_unlock(&ldap_pvt_thread_pool_mutex); #if 0 @@ -210,11 +207,7 @@ ldap_pvt_thread_pool_submit ( ctx->ltc_arg = arg; pool->ltp_pending_count++; - if (STAILQ_EMPTY(&pool->ltp_pending_list)) { - STAILQ_INSERT_HEAD(&pool->ltp_pending_list, ctx, ltc_next.q); - } else { - STAILQ_INSERT_TAIL(&pool->ltp_pending_list, ctx, ltc_next.q); - } + STAILQ_INSERT_TAIL(&pool->ltp_pending_list, ctx, ltc_next.q); ldap_pvt_thread_cond_signal(&pool->ltp_cond); if ((pool->ltp_open_count <= 0 || pool->ltp_pending_count > 1