- try to fix tomreyns bug
This commit is contained in:
parent
d35c1b6703
commit
e61a17972e
|
@ -319,7 +319,8 @@ SimpleTaskThread::SimpleTaskThread( SimpleTaskCallbackInterface *simpleTaskInter
|
||||||
|
|
||||||
setTaskSignalled(false);
|
setTaskSignalled(false);
|
||||||
|
|
||||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
//static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp,mutexOwnerId);
|
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp,mutexOwnerId);
|
||||||
mutexLastExecuteTimestamp.setOwnerId(mutexOwnerId);
|
mutexLastExecuteTimestamp.setOwnerId(mutexOwnerId);
|
||||||
lastExecuteTimestamp = time(NULL);
|
lastExecuteTimestamp = time(NULL);
|
||||||
|
@ -357,7 +358,8 @@ void SimpleTaskThread::setOverrideShutdownTask(taskFunctionCallback *ptr) {
|
||||||
|
|
||||||
bool SimpleTaskThread::isThreadExecutionLagging() {
|
bool SimpleTaskThread::isThreadExecutionLagging() {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
//static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp,mutexOwnerId);
|
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp,mutexOwnerId);
|
||||||
mutexLastExecuteTimestamp.setOwnerId(mutexOwnerId);
|
mutexLastExecuteTimestamp.setOwnerId(mutexOwnerId);
|
||||||
result = (difftime(time(NULL),lastExecuteTimestamp) >= 5.0);
|
result = (difftime(time(NULL),lastExecuteTimestamp) >= 5.0);
|
||||||
|
@ -409,11 +411,12 @@ void SimpleTaskThread::execute() {
|
||||||
else if(runTask == true) {
|
else if(runTask == true) {
|
||||||
if(getQuitStatus() == false) {
|
if(getQuitStatus() == false) {
|
||||||
ExecutingTaskSafeWrapper safeExecutingTaskMutex(this);
|
ExecutingTaskSafeWrapper safeExecutingTaskMutex(this);
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
this->simpleTaskInterface->simpleTask(this);
|
this->simpleTaskInterface->simpleTask(this);
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
//static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp,mutexOwnerId);
|
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp,mutexOwnerId);
|
||||||
mutexLastExecuteTimestamp.setOwnerId(mutexOwnerId);
|
mutexLastExecuteTimestamp.setOwnerId(mutexOwnerId);
|
||||||
lastExecuteTimestamp = time(NULL);
|
lastExecuteTimestamp = time(NULL);
|
||||||
|
@ -463,7 +466,8 @@ void SimpleTaskThread::execute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleTaskThread::setTaskSignalled(bool value) {
|
void SimpleTaskThread::setTaskSignalled(bool value) {
|
||||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
//static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
MutexSafeWrapper safeMutex(&mutexTaskSignaller,mutexOwnerId);
|
MutexSafeWrapper safeMutex(&mutexTaskSignaller,mutexOwnerId);
|
||||||
mutexTaskSignaller.setOwnerId(mutexOwnerId);
|
mutexTaskSignaller.setOwnerId(mutexOwnerId);
|
||||||
taskSignalled = value;
|
taskSignalled = value;
|
||||||
|
@ -472,7 +476,8 @@ void SimpleTaskThread::setTaskSignalled(bool value) {
|
||||||
|
|
||||||
bool SimpleTaskThread::getTaskSignalled() {
|
bool SimpleTaskThread::getTaskSignalled() {
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
//static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
MutexSafeWrapper safeMutex(&mutexTaskSignaller,mutexOwnerId);
|
MutexSafeWrapper safeMutex(&mutexTaskSignaller,mutexOwnerId);
|
||||||
mutexTaskSignaller.setOwnerId(mutexOwnerId);
|
mutexTaskSignaller.setOwnerId(mutexOwnerId);
|
||||||
retval = taskSignalled;
|
retval = taskSignalled;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user