summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2001-04-12 18:46:32 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2001-04-12 18:46:32 +0000
commit030b26a8b7e40d0d8fde0e95e83be9dcdcf56a83 (patch)
tree92e4d67b249a97e9df19c6eae75bfc7adcd37d56 /threadproc
parentad9f55780e69b62144f599bd0f5e861063c22458 (diff)
downloadlibapr-030b26a8b7e40d0d8fde0e95e83be9dcdcf56a83.tar.gz
Convert the apr_create_signal_thread to apr_signal_thread. The main
difference, is that instead of creating a separate thread to listen for signals, the thread that calls this function does the listening. Many platforms have issues when the main thread isn't the thread that is listening for signals. Even more platforms complain when the main thread dies, but the process doesn't. This gets the main thread back to being the signal handling thread. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61518 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r--threadproc/unix/signals.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
index 11d82aa6d..41d454307 100644
--- a/threadproc/unix/signals.c
+++ b/threadproc/unix/signals.c
@@ -268,7 +268,7 @@ const char *apr_signal_get_description(int signum)
#endif /* SYS_SIGLIST_DECLARED */
#if APR_HAS_THREADS && (HAVE_SIGSUSPEND || APR_HAVE_SIGWAIT) && !defined(OS2)
-static void *signal_thread_func(void *signal_handler)
+APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum))
{
sigset_t sig_mask;
int (*sig_func)(int signum) = (int (*)(int))signal_handler;
@@ -312,7 +312,7 @@ static void *signal_thread_func(void *signal_handler)
}
if (sig_func(signal_received) == 1) {
- return NULL;
+ return APR_SUCCESS;
}
#elif HAVE_SIGSUSPEND
sigsuspend(&sig_mask);
@@ -342,12 +342,4 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void)
return rv;
}
-APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td,
- apr_threadattr_t *tattr,
- int (*signal_handler)(int signum),
- apr_pool_t *p)
-{
- return apr_thread_create(td, tattr, signal_thread_func, (void *)signal_handler, p);
-}
-
#endif