From: Howard Chu Date: Fri, 21 Jan 2005 22:46:06 +0000 (+0000) Subject: Minor cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~286 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e67e45f75223916326884eefc58ea777de0db9f7;p=openldap Minor cleanup --- diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index 4b2223f3c7..fa6c5e8984 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -49,7 +49,7 @@ static struct berval bvtext; static int put_lineno; static int put_rc; -static int use_thread = 0; /*FIXME need a new switch for this */ +static int use_thread = 1; /*FIXME need a new switch for this */ static void *do_put(void *ptr) { @@ -399,13 +399,16 @@ slapadd( int argc, char **argv ) } if ( use_thread ) { + ldap_pvt_thread_mutex_lock( &put_mutex ); + /* Tell child thread to stop if it hasn't aborted */ if ( !put_rc ) { put_rc = EXIT_FAILURE; - ldap_pvt_thread_mutex_lock( &put_mutex ); ldap_pvt_thread_cond_signal( &put_cond ); - ldap_pvt_thread_mutex_unlock( &put_mutex ); } + ldap_pvt_thread_mutex_unlock( &put_mutex ); ldap_pvt_thread_join( put_tid, NULL ); + ldap_pvt_thread_mutex_destroy( &put_mutex ); + ldap_pvt_thread_cond_destroy( &put_cond ); } bvtext.bv_len = textlen;