summaryrefslogtreecommitdiffstats
path: root/threads.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-18 10:41:07 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-18 10:41:07 +0000
commita914e3164e5c9522b6ac9a39327ed46628d3e045 (patch)
tree54c679bbfa81a831a68563d979961f4db12db319 /threads.c
parent14df0c7c57ae3f41c56c73c1d17e40783758ec40 (diff)
downloadrsyslog-a914e3164e5c9522b6ac9a39327ed46628d3e045.tar.gz
rsyslog-a914e3164e5c9522b6ac9a39327ed46628d3e045.tar.xz
rsyslog-a914e3164e5c9522b6ac9a39327ed46628d3e045.zip
- removed no longer necessary signal from threads.c
- changed debug output request signal to SIGUSR2 (as originally intented), restored SIGUSR1 semantics
Diffstat (limited to 'threads.c')
-rw-r--r--threads.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/threads.c b/threads.c
index c7b5f4e4..5933d3e5 100644
--- a/threads.c
+++ b/threads.c
@@ -1,7 +1,3 @@
-/* TODO: we should guard the individual thread actions with a mutex. Else, we may
- * run into race conditions on thread termination.
- */
-
/* threads.c
*
* This file implements threading support helpers (and maybe the thread object)
@@ -128,13 +124,10 @@ static void* thrdStarter(void *arg)
assert(pThis != NULL);
assert(pThis->pUsrThrdMain != NULL);
- /* block all signals except the one we need for graceful termination */
+ /* block all signalsi */
sigset_t sigSet;
sigfillset(&sigSet);
pthread_sigmask(SIG_BLOCK, &sigSet, NULL);
- sigemptyset(&sigSet);
- sigaddset(&sigSet, SIGUSR2);
- pthread_sigmask(SIG_UNBLOCK, &sigSet, NULL);
/* setup complete, we are now ready to execute the user code. We will not
* regain control until the user code is finished, in which case we terminate
@@ -171,31 +164,13 @@ finalize_it:
}
-/* This is a dummy handler. We user SIGUSR2 to interrupt blocking system calls
- * if we are in termination mode 1.
- */
-static void sigusr2Dummy(int __attribute__((unused)) sig)
-{
- dbgprintf("sigusr2Dummy called!\n");
-}
-
-
/* initialize the thread-support subsystem
* must be called once at the start of the program
*/
rsRetVal thrdInit(void)
{
DEFiRet;
- struct sigaction sigAct;
-
iRet = llInit(&llThrds, thrdDestruct, NULL, NULL);
-
- /* set up our termination subsystem */
- memset(&sigAct, 0, sizeof (sigAct));
- sigemptyset(&sigAct.sa_mask);
- sigAct.sa_handler = sigusr2Dummy;
- sigaction(SIGUSR2, &sigAct, NULL);
-
RETiRet;
}