From: Mark Valence Date: Sat, 10 Jun 2000 01:39:05 +0000 (+0000) Subject: A little cleanup X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2676 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d6ee9542ec175a1b5dc9f355835d33b7b7d21ab1;p=openldap A little cleanup --- diff --git a/libraries/libldap_r/threads.c b/libraries/libldap_r/threads.c index 203ee2a515..ca9c7bafb0 100644 --- a/libraries/libldap_r/threads.c +++ b/libraries/libldap_r/threads.c @@ -49,8 +49,10 @@ typedef struct t_ldap_pvt_thread_ctx { void *ltc_arg; } ldap_pvt_thread_ctx; +#ifndef NO_THREADS ldap_pvt_thread_list ldap_pvt_thread_pool_list = NULL; ldap_pvt_thread_mutex_t ldap_pvt_thread_pool_mutex; +#endif void *ldap_pvt_thread_pool_wrapper( ldap_pvt_thread_pool_t pool ); void *ldap_pvt_thread_enlist( ldap_pvt_thread_list *list, void *elem ); @@ -65,9 +67,7 @@ ldap_pvt_thread_initialize ( void ) rc = ldap_int_thread_initialize(); if (rc == 0) { - /* init the mutex that protext the list of pools - */ - ldap_pvt_thread_mutex_init(&ldap_pvt_thread_pool_mutex); + ldap_pvt_thread_pool_startup(); } return rc; } @@ -75,11 +75,7 @@ ldap_pvt_thread_initialize ( void ) int ldap_pvt_thread_destroy ( void ) { - while (ldap_pvt_thread_pool_list != NULL) { - ldap_pvt_thread_pool_destroy((ldap_pvt_thread_pool_t)ldap_pvt_thread_pool_list, 0); - } - ldap_pvt_thread_mutex_destroy(&ldap_pvt_thread_pool_mutex); - + ldap_pvt_thread_pool_shutdown(); return ldap_int_thread_destroy(); }