static apr_pool_t *pchild; /* Pool for httpd child stuff */
static int server_pid;
+static int mpm_state = AP_MPMQ_STARTING;
/* Keep track of the number of worker threads currently active */
static int worker_thread_count;
static void ap_start_shutdown(void)
{
+ mpm_state = AP_MPMQ_STOPPING;
+
if (shutdown_pending == 1) {
/* Um, is this _probably_ not an error, if the user has
* tried to do a shutdown twice quickly, so we won't
/* do a graceful restart if graceful == 1 */
static void ap_start_restart(int graceful)
{
+ mpm_state = AP_MPMQ_STOPPING;
if (restart_pending == 1) {
/* Probably not an error - don't bother reporting it */
{
apr_size_t len;
int i = 0;
+
+ mpm_state = AP_MPMQ_STOPPING;
+
for (i = 0 ; i < ap_max_child_assigned; i++){
len = 4;
if (apr_sendto(udp_sock, udp_sa, 0, "die!", &len) != APR_SUCCESS)
int this_worker_should_exit = 0;
free(ti);
+ mpm_state = AP_MPMQ_STARTING;
+
on_exit_thread(check_restart, (void*)child_slot);
/* block the signals for this thread */
for(n=0 ; n <= num_listening_sockets ; n++)
apr_poll_socket_add(pollset, listening_sockets[n], APR_POLLIN);
+ mpm_state = AP_MPMQ_RUNNING;
+
while (1) {
/* If we're here, then chances are (unless we're the first thread created)
* we're going to be held up in the accept mutex, so doing this here
case AP_MPMQ_MAX_DAEMONS:
*result = HARD_SERVER_LIMIT;
return APR_SUCCESS;
+ case AP_MPMQ_MPM_STATE:
+ *result = mpm_state;
+ return APR_SUCCESS;
}
return APR_ENOTIMPL;
}
int no_detach, debug, foreground;
apr_status_t rv;
+ mpm_state = AP_MPMQ_STARTING;
+
debug = ap_exists_config_define("DEBUG");
if (debug) {
{
one_process = 0;
- ap_hook_pre_config(beos_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_pre_config(beos_pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
}
static const char *set_threads_to_start(cmd_parms *cmd, void *dummy, const char *arg)