2 * checkpointing module for the database
4 * Copyright (c) 1987-2009 by the citadel.org team
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include <sys/types.h>
34 #elif defined(HAVE_DB4_DB_H)
37 #error Neither <db.h> nor <db4/db.h> was found by configure. Install db4-devel.
41 #if DB_VERSION_MAJOR < 4 || DB_VERSION_MINOR < 1
42 #error Citadel requires Berkeley DB v4.1 or newer. Please upgrade.
45 #include <libcitadel.h>
49 #include "citserver.h"
52 #include "sysdep_decls.h"
56 #include "ctdl_module.h"
60 * Main loop for the checkpoint thread.
62 void *checkpoint_thread(void *arg) {
63 struct CitContext checkpointCC;
66 CtdlFillSystemContext(&checkpointCC, "checkpoint");
67 citthread_setspecific(MyConKey, (void *)&checkpointCC );
69 syslog(LOG_DEBUG, "checkpoint_thread() initializing\n");
70 while (!CtdlThreadCheckStop()) {
75 syslog(LOG_DEBUG, "checkpoint_thread() exiting\n");
76 CtdlClearSystemContext();
81 CTDL_MODULE_INIT(checkpoint) {
84 CtdlThreadCreate ("checkpoint", CTDLTHREAD_BIGSTACK, checkpoint_thread, NULL);
86 /* return our Subversion id for the Log */