]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
* There is now a dedicated thread for doing database checkpoints.
[citadel.git] / citadel / citserver.c
index 1c944f172db5e901653d9d2469af2bf933ad99fa..85f593641318e9bfdc56e7f1c72cf0ea5401ce6d 100644 (file)
@@ -101,7 +101,7 @@ void master_startup(void) {
        check_ref_counts();
 
        lprintf(CTDL_INFO, "Creating base rooms (if necessary)\n");
-       create_room(BASEROOM,           0, "", 0, 1, 0, VIEW_BBS);
+       create_room(config.c_baseroom,  0, "", 0, 1, 0, VIEW_BBS);
        create_room(AIDEROOM,           3, "", 0, 1, 0, VIEW_BBS);
        create_room(SYSCONFIGROOM,      3, "", 0, 1, 0, VIEW_BBS);
        create_room(config.c_twitroom,  0, "", 0, 1, 0, VIEW_BBS);
@@ -148,6 +148,14 @@ void master_cleanup(int exitcode) {
                (*fcn->h_function_pointer)();
        }
 
+       /* Shut down the indexer thread */
+       lprintf(CTDL_INFO, "Waiting for the indexer thread to shut down\n");
+       pthread_join(indexer_thread_tid, NULL);
+
+       /* Shut down the checkpoint thread */
+       lprintf(CTDL_INFO, "Waiting for the checkpoint thread to shut down\n");
+       pthread_join(checkpoint_thread_tid, NULL);
+
        /* Close databases */
        lprintf(CTDL_INFO, "Closing databases\n");
        close_databases();