]> git.stg.codes - stg.git/commitdiff
Block all signals earlie, to inherit by all nested threads
authorMaxim Mamontov <faust.madf@gmail.com>
Mon, 19 Sep 2011 07:53:02 +0000 (10:53 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Mon, 19 Sep 2011 07:53:02 +0000 (10:53 +0300)
projects/stargazer/main.cpp

index 80ec465b709bbeef47a85ae96553c0f53ba80f5b..3839ae8edb9495da7808fef22227a54744d7fdfc 100644 (file)
@@ -286,6 +286,10 @@ for (size_t i = 0; i < settings->GetExecutersNum(); i++)
 
 PIDFile pidFile(settings->GetPIDFileName());
 
 
 PIDFile pidFile(settings->GetPIDFileName());
 
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
 StartTimer();
 WaitTimer();
 if (!IsStgTimerRunning())
 StartTimer();
 WaitTimer();
 if (!IsStgTimerRunning())
@@ -393,10 +397,6 @@ WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
 creat(startFile.c_str(), S_IRUSR);
 #endif
 
 creat(startFile.c_str(), S_IRUSR);
 #endif
 
-sigset_t signalSet;
-sigfillset(&signalSet);
-pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
-
 while (true)
     {
     sigfillset(&signalSet);
 while (true)
     {
     sigfillset(&signalSet);