From 3c0e4d35a1459a02f27fc06f3a6b7fe8e0087a40 Mon Sep 17 00:00:00 2001 From: Mark Valence Date: Thu, 8 Jun 2000 06:55:04 +0000 Subject: [PATCH] Added a yield or two for Pth. --- libraries/libldap_r/threads.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/libldap_r/threads.c b/libraries/libldap_r/threads.c index 80a11cfa2c..203ee2a515 100644 --- a/libraries/libldap_r/threads.c +++ b/libraries/libldap_r/threads.c @@ -452,6 +452,10 @@ ldap_pvt_thread_pool_wrapper ( ldap_pvt_thread_pool_t pool ) * only die if there are other open threads (i.e., * always have at least one thread open). */ + ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); + ldap_pvt_thread_yield(); + ldap_pvt_thread_mutex_lock(&pool->ltp_mutex); + if (pool->ltp_state == LDAP_PVT_THREAD_POOL_RUNNING) ldap_pvt_thread_cond_wait(&pool->ltp_cond, &pool->ltp_mutex); @@ -464,6 +468,7 @@ ldap_pvt_thread_pool_wrapper ( ldap_pvt_thread_pool_t pool ) (ctx->ltc_start_routine)(ctx->ltc_arg); free(ctx); + ldap_pvt_thread_yield(); /* if we use an idle timer, here's * a good place to update it -- 2.39.5