]> git.stg.codes - stg.git/blobdiff - projects/stargazer/main.cpp
Block all signals earlie, to inherit by all nested threads
[stg.git] / 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());
 
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
 StartTimer();
 WaitTimer();
 if (!IsStgTimerRunning())
@@ -393,10 +397,6 @@ WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
 creat(startFile.c_str(), S_IRUSR);
 #endif
 
-sigset_t signalSet;
-sigfillset(&signalSet);
-pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
-
 while (true)
     {
     sigfillset(&signalSet);