X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Fmain.c;h=9ba0a6c8be9798de800a0568226d2ee14c0130fe;hb=9568a013a8793ab5eddc2acb5c8027fb5a757a0c;hp=3e3c81175680fad3f9b488df63238d9ba73a1147;hpb=984bdfa605cccbe47ff1a83118b13c399b62821a;p=openldap diff --git a/servers/slurpd/main.c b/servers/slurpd/main.c index 3e3c811756..9ba0a6c8be 100644 --- a/servers/slurpd/main.c +++ b/servers/slurpd/main.c @@ -38,6 +38,9 @@ main( int i; + /* initialize thread package */ + ldap_pvt_thread_initialize(); + /* * Create and initialize globals. init_globals() also initializes * the main replication queue. @@ -92,9 +95,6 @@ main( #endif /* LDAP_DEBUG */ lutil_detach( 0, 0 ); - /* initialize thread package */ - ldap_pvt_thread_initialize(); - /* * Start threads - one thread for each replica */ @@ -125,9 +125,11 @@ main( for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) { ldap_pvt_thread_join( sglob->replicas[ i ]->ri_tid, (void *) NULL ); } - Debug( LDAP_DEBUG_ANY, "slurpd: terminating normally\n", 0, 0, 0 ); - sglob->slurpd_shutdown = 1; + /* destroy the thread package */ + ldap_pvt_thread_destroy(); + + Debug( LDAP_DEBUG_ANY, "slurpd: terminated.\n", 0, 0, 0 ); return 0; #endif /* !NO_THREADS */ }