]> git.sur5r.net Git - openldap/commitdiff
Fix a race condition by removing (unnecessary) unlock/yield/lock.
authorMark Valence <mrv@openldap.org>
Sat, 10 Jun 2000 04:12:49 +0000 (04:12 +0000)
committerMark Valence <mrv@openldap.org>
Sat, 10 Jun 2000 04:12:49 +0000 (04:12 +0000)
libraries/libldap_r/threads.c

index ca9c7bafb09eb97733edebc9aa09b52028ded9d1..22f3e4508a1079096046e75f4e93d52451308e3a 100644 (file)
@@ -54,6 +54,8 @@ ldap_pvt_thread_list ldap_pvt_thread_pool_list = NULL;
 ldap_pvt_thread_mutex_t ldap_pvt_thread_pool_mutex;
 #endif
 
+int ldap_pvt_thread_pool_startup ( void );
+int ldap_pvt_thread_pool_shutdown ( void );
 void *ldap_pvt_thread_pool_wrapper( ldap_pvt_thread_pool_t pool );
 void *ldap_pvt_thread_enlist( ldap_pvt_thread_list *list, void *elem );
 void *ldap_pvt_thread_delist( ldap_pvt_thread_list *list, void *elem );
@@ -448,9 +450,6 @@ 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);