]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/ping/ping.cpp
Block all signals in threads other than main
[stg.git] / projects / stargazer / plugins / other / ping / ping.cpp
index c824067979e3243711ffe7f5e813b21692b0368c..f4755c230491f73cbec8e7f8c63e22b4ea9bc45f 100644 (file)
@@ -167,7 +167,11 @@ return isRunning;
 //-----------------------------------------------------------------------------
 void * PING::Run(void * d)
 {
-PING * ping = (PING *)d;
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
+PING * ping = static_cast<PING *>(d);
 ping->isRunning = true;
 
 long delay = (10000000 * ping->pingSettings.GetPingDelay()) / 3 + 50000000;