]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/main.c
Backend lock wasn't being released properly.
[openldap] / servers / slurpd / main.c
index 3e3c81175680fad3f9b488df63238d9ba73a1147..9ba0a6c8be9798de800a0568226d2ee14c0130fe 100644 (file)
@@ -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 */
 }