2127 unsigned int sleepSec = 0;
2128 unsigned int sleepMilliSec = 0;
2131 status = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
2134 printf(
"Set cancel state error [LogWatchDog]: %d\n", status);
2138 "Can not set cancel state for LogWatchDog thread. WatchDog should not not be affected.",
2141 status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
2144 printf(
"Set cancel type error [LogWatchDog]: %d\n", status);
2148 "Can not set cancel type for LogWatchDog thread. WatchDog should not not be affected.",
2155 "LogWatchDog thread for filtering replicated log messages successfully started.",
2158 printf(
"LogWatchDog thread for filtering replicated log messages successfully started.\n");
2165 status = pthread_mutex_lock(&
log_mut);
2169 printf(
"Lock log mutex error: %d\n", status);
2178 status = pthread_mutex_unlock(&
log_mut);
2182 printf(
"Unlock log mutex error: %d\n", status);
2188 pthread_testcancel();
2192 usleep(sleepMilliSec * 1000);
2195 pthread_testcancel();
unsigned int dtq_sleep(int secs)
void createLogMessage(unsigned int type, char *description, char *origin)
bool checkReplicatedLogMessage()
static unsigned int logWatchDogTimeout
static pthread_mutex_t log_mut
static bool logWatchDogRunning