mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 05:13:59 +02:00
- added a new thread manager to try to see if it takes less CPU cycles while the thread controller waits for slaves to do their work. To enable the experimental thread manager set: EnableNewThreadManager=true
This commit is contained in:
@@ -59,7 +59,7 @@ void Thread::start() {
|
||||
assert(thread != NULL);
|
||||
if(thread == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] thread == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] thread == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ int Thread::beginExecution(void* data) {
|
||||
assert(thread != NULL);
|
||||
if(thread == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] thread == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] thread == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
thread->execute();
|
||||
@@ -140,7 +140,7 @@ Mutex::Mutex(string ownerId) {
|
||||
assert(mutex != NULL);
|
||||
if(mutex == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
deleteownerId = "";
|
||||
@@ -150,13 +150,13 @@ Mutex::~Mutex() {
|
||||
SDLMutexSafeWrapper safeMutex(&mutexAccessor,true);
|
||||
if(mutex == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]",__FILE__,__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
//printf("%s\n",szBuf);
|
||||
}
|
||||
else if(refCount >= 1) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] about to destroy mutex refCount = %d owner [%s] deleteownerId [%s]",__FILE__,__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] about to destroy mutex refCount = %d owner [%s] deleteownerId [%s]",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ Mutex::~Mutex() {
|
||||
void Mutex::p() {
|
||||
if(mutex == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]",__FILE__,__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
SDL_mutexP(mutex);
|
||||
@@ -180,7 +180,7 @@ void Mutex::p() {
|
||||
void Mutex::v() {
|
||||
if(mutex == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]",__FILE__,__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str());
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
refCount--;
|
||||
@@ -195,7 +195,7 @@ Semaphore::Semaphore(Uint32 initialValue) {
|
||||
semaphore = SDL_CreateSemaphore(initialValue);
|
||||
if(semaphore == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
}
|
||||
@@ -203,7 +203,7 @@ Semaphore::Semaphore(Uint32 initialValue) {
|
||||
Semaphore::~Semaphore() {
|
||||
if(semaphore == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
SDL_DestroySemaphore(semaphore);
|
||||
@@ -213,7 +213,7 @@ Semaphore::~Semaphore() {
|
||||
void Semaphore::signal() {
|
||||
if(semaphore == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
SDL_SemPost(semaphore);
|
||||
@@ -222,7 +222,7 @@ void Semaphore::signal() {
|
||||
int Semaphore::waitTillSignalled(int waitMilliseconds) {
|
||||
if(semaphore == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
int semValue = 0;
|
||||
@@ -235,16 +235,43 @@ int Semaphore::waitTillSignalled(int waitMilliseconds) {
|
||||
return semValue;
|
||||
}
|
||||
|
||||
bool Semaphore::tryDecrement() {
|
||||
if(semaphore == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
int semValue = SDL_SemTryWait(semaphore);
|
||||
return (semValue == 0);
|
||||
}
|
||||
|
||||
uint32 Semaphore::getSemValue() {
|
||||
if(semaphore == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",__FILE__,__FUNCTION__,__LINE__);
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
return SDL_SemValue(semaphore);
|
||||
}
|
||||
|
||||
void Semaphore::resetSemValue(Uint32 initialValue) {
|
||||
if(semaphore == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] semaphore == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
uint32 currentValue = SDL_SemValue(semaphore);
|
||||
for(unsigned int i = currentValue; i < initialValue; ++i) {
|
||||
SDL_SemPost(semaphore);
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// class ReadWriteMutex
|
||||
// =====================================================
|
||||
|
||||
ReadWriteMutex::ReadWriteMutex(int maxReaders) : semaphore(maxReaders) {
|
||||
this->maxReadersCount = maxReaders;
|
||||
}
|
||||
@@ -273,5 +300,232 @@ int ReadWriteMutex::maxReaders() {
|
||||
return this->maxReadersCount;
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// class Trigger
|
||||
// =====================================================
|
||||
|
||||
Trigger::Trigger(Mutex *mutex) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
this->mutex = mutex;
|
||||
this->trigger = SDL_CreateCond();
|
||||
if(this->trigger == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] trigger == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
Trigger::~Trigger() {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
if(trigger == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] trigger == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
SDL_DestroyCond(trigger);
|
||||
trigger = NULL;
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
this->mutex = NULL;
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void Trigger::signal(bool allThreads) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
if(trigger == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] trigger == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
//MutexSafeWrapper safeMutex(mutex);
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
if(allThreads == false) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
int result = SDL_CondSignal(trigger);
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] result = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,result);
|
||||
}
|
||||
else {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
int result = SDL_CondBroadcast(trigger);
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] result = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,result);
|
||||
}
|
||||
|
||||
//safeMutex.ReleaseLock();
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
int Trigger::waitTillSignalled(Mutex *mutex, int waitMilliseconds) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
if(trigger == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] trigger == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
if(mutex == NULL) {
|
||||
char szBuf[1024]="";
|
||||
snprintf(szBuf,1023,"In [%s::%s Line: %d] mutex == NULL",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
int result = 0;
|
||||
if(waitMilliseconds >= 0) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
result = SDL_CondWaitTimeout(trigger,mutex->getMutex(),waitMilliseconds);
|
||||
}
|
||||
else {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
result = SDL_CondWait(trigger, mutex->getMutex());
|
||||
}
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
MasterSlaveThreadController::MasterSlaveThreadController() {
|
||||
std::vector<SlaveThreadControllerInterface *> empty;
|
||||
init(empty);
|
||||
}
|
||||
|
||||
MasterSlaveThreadController::MasterSlaveThreadController(std::vector<SlaveThreadControllerInterface *> &slaveThreadList) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] ==========================================================\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
init(slaveThreadList);
|
||||
}
|
||||
|
||||
void MasterSlaveThreadController::init(std::vector<SlaveThreadControllerInterface *> &newSlaveThreadList) {
|
||||
static string masterSlaveOwnerId = string(__FILE__) + string("_MasterSlaveThreadController");
|
||||
this->mutex = new Mutex(masterSlaveOwnerId);
|
||||
this->slaveTriggerSem = new Semaphore(0);
|
||||
this->slaveTriggerCounter = newSlaveThreadList.size() + triggerBaseCount;
|
||||
setSlaves(newSlaveThreadList);
|
||||
}
|
||||
|
||||
void MasterSlaveThreadController::clearSlaves(bool clearListOnly) {
|
||||
if(this->slaveThreadList.empty() == false) {
|
||||
if(clearListOnly == false) {
|
||||
for(unsigned int i = 0; i < this->slaveThreadList.size(); ++i) {
|
||||
SlaveThreadControllerInterface *slave = this->slaveThreadList[i];
|
||||
slave->setMasterController(NULL);
|
||||
}
|
||||
}
|
||||
this->slaveThreadList.clear();
|
||||
}
|
||||
}
|
||||
|
||||
MasterSlaveThreadController::~MasterSlaveThreadController() {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
clearSlaves();
|
||||
|
||||
delete slaveTriggerSem;
|
||||
slaveTriggerSem = NULL;
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] mutex->getRefCount() = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,mutex->getRefCount());
|
||||
|
||||
delete mutex;
|
||||
mutex = NULL;
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void MasterSlaveThreadController::setSlaves(std::vector<SlaveThreadControllerInterface *> &slaveThreadList) {
|
||||
this->slaveThreadList = slaveThreadList;
|
||||
|
||||
if(this->slaveThreadList.empty() == false) {
|
||||
for(unsigned int i = 0; i < this->slaveThreadList.size(); ++i) {
|
||||
SlaveThreadControllerInterface *slave = this->slaveThreadList[i];
|
||||
slave->setMasterController(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MasterSlaveThreadController::signalSlaves(void *userdata) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
slaveTriggerCounter = this->slaveThreadList.size() + triggerBaseCount;
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
if(this->slaveThreadList.empty() == false) {
|
||||
for(unsigned int i = 0; i < this->slaveThreadList.size(); ++i) {
|
||||
SlaveThreadControllerInterface *slave = this->slaveThreadList[i];
|
||||
slave->signalSlave(userdata);
|
||||
}
|
||||
}
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void MasterSlaveThreadController::triggerMaster(int waitMilliseconds) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
MutexSafeWrapper safeMutex(mutex);
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] semVal = %u\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,slaveTriggerCounter);
|
||||
|
||||
slaveTriggerCounter--;
|
||||
int newCount = slaveTriggerCounter;
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] slaveTriggerCounter = %u\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,slaveTriggerCounter);
|
||||
|
||||
safeMutex.ReleaseLock();
|
||||
|
||||
if(newCount <= triggerBaseCount) {
|
||||
slaveTriggerSem->signal();
|
||||
}
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
bool MasterSlaveThreadController::waitTillSlavesTrigger(int waitMilliseconds) {
|
||||
bool result = true;
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] slaveTriggerCounter = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,slaveTriggerCounter);
|
||||
|
||||
if(this->slaveThreadList.empty() == false) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] slaveTriggerCounter = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,slaveTriggerCounter);
|
||||
|
||||
int slaveResult = slaveTriggerSem->waitTillSignalled(waitMilliseconds);
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] slaveTriggerCounter = %d slaveResult = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,slaveTriggerCounter,slaveResult);
|
||||
|
||||
if(slaveResult != 0) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
result = false;
|
||||
}
|
||||
else if(slaveResult == 0) {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] slaveTriggerCounter = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,slaveTriggerCounter);
|
||||
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}}//end namespace
|
||||
|
Reference in New Issue
Block a user