diff options
author | Ruediger Pluem <rpluem@apache.org> | 2020-10-09 21:32:27 +0200 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2020-10-09 21:32:27 +0200 |
commit | 39c55b426afe4aa9ebf70647822cc4a07dd8277a (patch) | |
tree | 192d9e4ca590277b4806a06d51fae9302c04dd30 /server | |
parent | rebuild all for russian langage integration. (diff) | |
download | apache2-39c55b426afe4aa9ebf70647822cc4a07dd8277a.tar.xz apache2-39c55b426afe4aa9ebf70647822cc4a07dd8277a.zip |
Adjust signal handler before unblocking
* server/mpm/event/event.c: Set the new signal handler before unblocking the
signal as otherwise queued signals get delivered to the old handler
immediately when the signal is unblocked.
* server/mpm/worker/worker.c: Same thing as with event.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1882370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/mpm/event/event.c | 4 | ||||
-rw-r--r-- | server/mpm/worker/worker.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 69384652b8..d949a0ad74 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1836,8 +1836,8 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) /* Unblock the signal used to wake this thread up, and set a handler for * it. */ - unblock_signal(LISTENER_SIGNAL); apr_signal(LISTENER_SIGNAL, dummy_signal_handler); + unblock_signal(LISTENER_SIGNAL); for (;;) { timer_event_t *te; @@ -2897,8 +2897,8 @@ static void child_main(int child_num_arg, int child_bucket) * the other threads in the process needs to take us down * (e.g., for MaxConnectionsPerChild) it will send us SIGTERM */ - unblock_signal(SIGTERM); apr_signal(SIGTERM, dummy_signal_handler); + unblock_signal(SIGTERM); /* Watch for any messages from the parent over the POD */ while (1) { rv = ap_mpm_podx_check(my_bucket->pod); diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 0b10eeec87..94c47ef755 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -554,8 +554,8 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t *thd, void * dummy) /* Unblock the signal used to wake this thread up, and set a handler for * it. */ - unblock_signal(LISTENER_SIGNAL); apr_signal(LISTENER_SIGNAL, dummy_signal_handler); + unblock_signal(LISTENER_SIGNAL); /* TODO: Switch to a system where threads reuse the results from earlier poll calls - manoj */ @@ -753,8 +753,8 @@ static void * APR_THREAD_FUNC worker_thread(apr_thread_t *thd, void * dummy) SERVER_STARTING, NULL); #ifdef HAVE_PTHREAD_KILL - unblock_signal(WORKER_SIGNAL); apr_signal(WORKER_SIGNAL, dummy_signal_handler); + unblock_signal(WORKER_SIGNAL); #endif while (!workers_may_exit) { @@ -1235,8 +1235,8 @@ static void child_main(int child_num_arg, int child_bucket) * the other threads in the process needs to take us down * (e.g., for MaxConnectionsPerChild) it will send us SIGTERM */ - unblock_signal(SIGTERM); apr_signal(SIGTERM, dummy_signal_handler); + unblock_signal(SIGTERM); /* Watch for any messages from the parent over the POD */ while (1) { rv = ap_mpm_podx_check(my_bucket->pod); |