4 * checkpointing module for the database
6 * Copyright (c) 1987-2009 by the citadel.org team
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #include <sys/types.h>
36 #elif defined(HAVE_DB4_DB_H)
39 #error Neither <db.h> nor <db4/db.h> was found by configure. Install db4-devel.
43 #if DB_VERSION_MAJOR < 4 || DB_VERSION_MINOR < 1
44 #error Citadel requires Berkeley DB v4.1 or newer. Please upgrade.
47 #include <libcitadel.h>
51 #include "citserver.h"
54 #include "sysdep_decls.h"
58 #include "ctdl_module.h"
62 * Main loop for the checkpoint thread.
64 void *checkpoint_thread(void *arg) {
65 struct CitContext checkpointCC;
68 CtdlFillSystemContext(&checkpointCC, "checkpoint");
69 citthread_setspecific(MyConKey, (void *)&checkpointCC );
71 CtdlLogPrintf(CTDL_DEBUG, "checkpoint_thread() initializing\n");
72 while (!CtdlThreadCheckStop()) {
77 CtdlLogPrintf(CTDL_DEBUG, "checkpoint_thread() exiting\n");
78 CtdlClearSystemContext();
83 CTDL_MODULE_INIT(checkpoint) {
86 CtdlThreadCreate ("checkpoint", CTDLTHREAD_BIGSTACK, checkpoint_thread, NULL);
88 /* return our Subversion id for the Log */