X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fsysdep.c;h=1179ea604fcee87a6c8a8f6ae77ee7fec0db7428;hb=5cbfcc2545d5b9f6b947c7fecd1f9f81cabbae4a;hp=b71c068a2819e4f359d47c1b64109f46bf346c90;hpb=596a7da4859d0dbf87fba6f6587c612e1cda95ac;p=citadel.git diff --git a/citadel/sysdep.c b/citadel/sysdep.c index b71c068a2..1179ea604 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -99,6 +99,7 @@ time_t last_purge = 0; /* Last dead session purge */ static int num_threads = 0; /* Current number of threads */ int num_sessions = 0; /* Current number of sessions */ pthread_t indexer_thread_tid; +pthread_t checkpoint_thread_tid; int syslog_facility = (-1); int enable_syslog = 0; @@ -815,8 +816,9 @@ void create_worker(void) { /* * Create the indexer thread and begin its operation. + * Then create the checkpoint thread and begin its operation. */ -void create_indexer_thread(void) { +void create_maintenance_threads(void) { int ret; pthread_attr_t attr; @@ -838,10 +840,12 @@ void create_indexer_thread(void) { return; } - if ((ret = pthread_create(&indexer_thread_tid, &attr, indexer_thread, NULL) != 0)) - { - lprintf(CTDL_ALERT, "Can't create indexer thread: %s\n", - strerror(ret)); + if ((ret = pthread_create(&indexer_thread_tid, &attr, indexer_thread, NULL) != 0)) { + lprintf(CTDL_ALERT, "Can't create thread: %s\n", strerror(ret)); + } + + if ((ret = pthread_create(&checkpoint_thread_tid, &attr, checkpoint_thread, NULL) != 0)) { + lprintf(CTDL_ALERT, "Can't create thread: %s\n", strerror(ret)); } pthread_attr_destroy(&attr);