More for threadqueues

Revert previous patch, just delete all the associated juggling.
No longer serves any purpose.
This commit is contained in:
Howard Chu 2015-08-22 13:50:40 +01:00
parent c034282b14
commit ed2a625de6

View File

@ -128,7 +128,7 @@ struct ldap_int_thread_poolq_s {
int ltp_pending_count; /* Pending + paused + idle tasks */
int ltp_active_count; /* Active, not paused/idle tasks */
int ltp_open_count; /* Number of threads, negated when ltp_pause */
int ltp_open_count; /* Number of threads */
int ltp_starting; /* Currently starting threads */
};
@ -971,10 +971,7 @@ ldap_int_thread_pool_wrapper (
thread_keys[keyslot].ctx = DELETED_THREAD_CTX;
ldap_pvt_thread_mutex_unlock(&ldap_pvt_thread_pool_mutex);
if (pq->ltp_open_count < 0)
pq->ltp_open_count++;
else
pq->ltp_open_count--;
pq->ltp_open_count--;
if (pq->ltp_open_count == 0) {
if (pool->ltp_finishing)
/* let pool_destroy know we're all done */
@ -1093,9 +1090,6 @@ handle_pause( ldap_pvt_thread_pool_t *tpool, int pause_type )
if (j != i)
ldap_pvt_thread_mutex_lock(&pq->ltp_mutex);
/* Let ldap_pvt_thread_pool_submit() through to its ltp_pause test,
* and do not finish threads in ldap_pvt_thread_pool_wrapper() */
pq->ltp_open_count = -pq->ltp_open_count;
/* Hide pending tasks from ldap_pvt_thread_pool_wrapper() */
pq->ltp_work_list = &empty_pending_list;
@ -1182,8 +1176,6 @@ ldap_pvt_thread_pool_resume (
pool->ltp_pause = 0;
for (i=0; i<pool->ltp_numqs; i++) {
pq = pool->ltp_wqs[i];
if (pq->ltp_open_count <= 0) /* true when paused, but be paranoid */
pq->ltp_open_count = -pq->ltp_open_count;
pq->ltp_work_list = &pq->ltp_pending_list;
ldap_pvt_thread_cond_broadcast(&pq->ltp_cond);
}