/*
* Thread handling stuff for Citadel server
*
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2015 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 3.
#include "modules_init.h"
#include "serv_extensions.h"
#include "ctdl_module.h"
+#include "config.h"
#include "context.h"
#include "threads.h"
* they are all in use.
*/
while (!server_shutting_down) {
- if ((active_workers == num_workers) && (num_workers < config.c_max_workers)) {
+ if ((active_workers == num_workers) && (num_workers < CtdlGetConfigInt("c_max_workers"))) {
CtdlThreadCreate(worker_thread);
}
usleep(1000000);
}
/* When we get to this point we are getting ready to shut down our Citadel server */
- if (!EventQShuttingDown)
- {
- EventQShuttingDown = 1;
- ShutDownEventQueues();
- }
- while (!EVQShutDown)
- usleep(1000000);
-
-
terminate_all_sessions(); /* close all client sockets */
CtdlShutdownServiceHooks(); /* close all listener sockets to prevent new connections */
PerformSessionHooks(EVT_SHUTDOWN); /* run any registered shutdown hooks */