X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..8d7e73beecd0d372eb59ad74bf60e25f67013201:/projects/stargazer/eventloop.cpp diff --git a/projects/stargazer/eventloop.cpp b/projects/stargazer/eventloop.cpp index 4cd6074b..36a77e9e 100644 --- a/projects/stargazer/eventloop.cpp +++ b/projects/stargazer/eventloop.cpp @@ -1,12 +1,18 @@ +#include #include #include +#include "stg/locker.h" +#include "stg/common.h" #include "eventloop.h" -#include "stg_locker.h" -#include "common.h" EVENT_LOOP::EVENT_LOOP() - : ACTIONS_LIST() + : ACTIONS_LIST(), + _running(false), + _stopped(true), + _tid(), + _mutex(), + _condition() { pthread_mutex_init(&_mutex, NULL); pthread_cond_init(&_condition, NULL); @@ -48,12 +54,16 @@ return NULL; void EVENT_LOOP::Runner() { +sigset_t signalSet; +sigfillset(&signalSet); +pthread_sigmask(SIG_BLOCK, &signalSet, NULL); + _stopped = false; printfd(__FILE__, "EVENT_LOOP::Runner - Before start\n"); while (_running) { { - STG_LOCKER lock(&_mutex, __FILE__, __LINE__); + STG_LOCKER lock(&_mutex); // Check for any actions... if (empty()) { @@ -91,7 +101,7 @@ EVENT_LOOP & EVENT_LOOP_SINGLETON::GetInstance() // Double-checking technique if (!_instance) { - STG_LOCKER lock(&singletonMutex, __FILE__, __LINE__); + STG_LOCKER lock(&singletonMutex); if (!_instance) { CreateInstance();