/*
- * $Id: sysdep.c 5882 2007-12-13 19:46:05Z davew $
+ * $Id$
*
* Citadel "system dependent" stuff.
- * See copyright.txt for copyright information.
+ * See COPYING for copyright information.
*
* Here's where we have the Citadel thread implimentation
*
*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/socket.h>
# endif
#endif
+#include <libcitadel.h>
+
#include "threads.h"
#include "ctdl_module.h"
#include "modules_init.h"
*/
void CtdlThreadStopAll(void)
{
+ /* First run any registered shutdown hooks. This probably doesn't belong here. */
+ PerformSessionHooks(EVT_SHUTDOWN);
+
//FIXME: The signalling of the condition should not be in the critical_section
// We need to build a list of threads we are going to signal and then signal them afterwards
CtdlThreadNode *this_thread, *that_thread;
time_t now;
+ /* Don't start scheduled threads if the system wants single user mode */
+ if (CtdlWantSingleUser())
+ return;
+
if (try_critical_section(S_SCHEDULE_LIST))
return; /* If this list is locked we wait till the next chance */