summaryrefslogtreecommitdiff
path: root/TSRM/TSRM.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2011-06-02 21:16:50 +0000
committerIlia Alshanetsky <iliaa@php.net>2011-06-02 21:16:50 +0000
commit939875133a2c389d621a9999a8ede3ddbc9b6637 (patch)
tree110835541d96f1f8cbb147c36ae6d7d023790933 /TSRM/TSRM.c
parente87534b01715d8da78f96f72f6127de67664b2a0 (diff)
downloadphp-git-939875133a2c389d621a9999a8ede3ddbc9b6637.tar.gz
Zend Signal Handling (see RFC: https://wiki.php.net/rfc/zendsignals)
This needs to go into 5.4 as well, but will wait for Pierre to review win32 situation # Patch by Lucas Nealan, Arnaud Le Blanc, Brian Shire & Ilia Alshanetsky
Diffstat (limited to 'TSRM/TSRM.c')
-rw-r--r--TSRM/TSRM.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index 41368a4987..efdea5c880 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -710,6 +710,22 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
#endif
}
+/*
+ Changes the signal mask of the calling thread
+*/
+#ifdef HAVE_SIGPROCMASK
+TSRM_API int tsrm_sigmask(int how, const sigset_t *set, sigset_t *oldset)
+{
+ TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Changed sigmask in thread: %ld", tsrm_thread_id()));
+ /* TODO: add support for other APIs */
+#ifdef PTHREADS
+ return pthread_sigmask(how, set, oldset);
+#else
+ return sigprocmask(how, set, oldset);
+#endif
+}
+#endif
+
TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler)
{