return( 1 );
#else
- int status;
int i;
+ /* initialize thread package */
+ ldap_pvt_thread_initialize();
+
/*
* Create and initialize globals. init_globals() also initializes
* the main replication queue.
#endif /* LDAP_DEBUG */
lutil_detach( 0, 0 );
- /* initialize thread package */
- ldap_pvt_thread_initialize();
-
/*
* Start threads - one thread for each replica
*/
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 */
}