git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New signal handling infrastructure. Prevent unloading running module.
[stg.git]
/
projects
/
rscriptd
/
listener.cpp
diff --git
a/projects/rscriptd/listener.cpp
b/projects/rscriptd/listener.cpp
index d4f2dc937b56401519bca2dbdeffb546cf450639..730426744e50508556802c06d7bddcb81be91022 100644
(file)
--- a/
projects/rscriptd/listener.cpp
+++ b/
projects/rscriptd/listener.cpp
@@
-165,6
+165,10
@@
return false;
//-----------------------------------------------------------------------------
void * LISTENER::Run(void * d)
{
//-----------------------------------------------------------------------------
void * LISTENER::Run(void * d)
{
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
LISTENER * listener = static_cast<LISTENER *>(d);
listener->Runner();
LISTENER * listener = static_cast<LISTENER *>(d);
listener->Runner();
@@
-186,6
+190,10
@@
receiverStopped = true;
//-----------------------------------------------------------------------------
void * LISTENER::RunProcessor(void * d)
{
//-----------------------------------------------------------------------------
void * LISTENER::RunProcessor(void * d)
{
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
LISTENER * listener = static_cast<LISTENER *>(d);
listener->ProcessorRunner();
LISTENER * listener = static_cast<LISTENER *>(d);
listener->ProcessorRunner();