/*
- * $Id: serv_checkpoint.c 5756 2007-11-16 17:15:22Z ajc $
+ * $Id$
*
* checkpointing module for the database
*/
#error Citadel requires Berkeley DB v4.1 or newer. Please upgrade.
#endif
+#include <libcitadel.h>
+
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#include "msgbase.h"
#include "sysdep_decls.h"
#include "config.h"
+#include "threads.h"
#include "ctdl_module.h"
void *checkpoint_thread(void *arg) {
struct CitContext checkpointCC;
- CT_PUSH();
-
CtdlLogPrintf(CTDL_DEBUG, "checkpoint_thread() initializing\n");
- memset(&checkpointCC, 0, sizeof(struct CitContext));
- checkpointCC.internal_pgm = 1;
- checkpointCC.cs_pid = 0;
- pthread_setspecific(MyConKey, (void *)&checkpointCC );
-
- cdb_allocate_tsd();
+ CtdlFillSystemContext(&checkpointCC, "checkpoint");
+ citthread_setspecific(MyConKey, (void *)&checkpointCC );
- while (!CtdlThreadCheckStop(CT)) {
+ while (!CtdlThreadCheckStop()) {
cdb_checkpoint();
CtdlThreadSleep(60);
}
CtdlThreadCreate ("checkpoint", CTDLTHREAD_BIGSTACK, checkpoint_thread, NULL);
}
/* return our Subversion id for the Log */
- return "$Id: serv_autocompletion.c 5756 2007-11-16 17:15:22Z ajc $";
+ return "$Id$";
}