]> git.sur5r.net Git - openldap/commitdiff
Added a yield or two for Pth.
authorMark Valence <mrv@openldap.org>
Thu, 8 Jun 2000 06:55:04 +0000 (06:55 +0000)
committerMark Valence <mrv@openldap.org>
Thu, 8 Jun 2000 06:55:04 +0000 (06:55 +0000)
libraries/libldap_r/threads.c

index 80a11cfa2c877b2730fe6271989fd1b9b909e342..203ee2a51549361a9ae54e179cd93be5a02c1269 100644 (file)
@@ -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