From: Art Cancro Date: Sun, 17 Feb 2008 04:56:49 +0000 (+0000) Subject: The auto-purger has its own thread so it needs its own X-Git-Tag: v7.86~2478 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=bb20d86f52665a265e555317ab8946dfb78d558e The auto-purger has its own thread so it needs its own CitContext. Sharing the masterCC with housekeeping threads could be causing data corruption issues. --- diff --git a/citadel/modules/expire/serv_expire.c b/citadel/modules/expire/serv_expire.c index 80d38c48c..64defd28b 100644 --- a/citadel/modules/expire/serv_expire.c +++ b/citadel/modules/expire/serv_expire.c @@ -756,6 +756,14 @@ void *purge_databases(void *args) static time_t last_purge = 0; time_t now; struct tm tm; + struct CitContext purgerCC; + + lprintf(CTDL_DEBUG, "indexer_thread() initializing\n"); + + memset(&purgerCC, 0, sizeof(struct CitContext)); + purgerCC.internal_pgm = 1; + purgerCC.cs_pid = 0; + pthread_setspecific(MyConKey, (void *)&purgerCC ); while (!CtdlThreadCheckStop()) { /* Do the auto-purge if the current hour equals the purge hour,