- numerous thread bugfixes related to menu stability and ftp server socket usage

This commit is contained in:
Mark Vejvoda
2011-01-02 09:33:37 +00:00
parent 2b1732e27e
commit 5f4d3e9088
16 changed files with 235 additions and 100 deletions

View File

@@ -29,6 +29,7 @@ BaseThread::BaseThread() : Thread() {
setHasBeginExecution(false);
setExecutingTask(false);
setDeleteSelfOnExecutionDone(false);
setThreadOwnerValid(true);
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
@@ -39,6 +40,28 @@ BaseThread::~BaseThread() {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] uniqueID [%s] ret [%d] END\n",__FILE__,__FUNCTION__,__LINE__,uniqueID.c_str(),ret);
}
Mutex * BaseThread::getMutexThreadOwnerValid() {
if(getThreadOwnerValid() == true) {
return &mutexThreadOwnerValid;
}
return NULL;
}
void BaseThread::setThreadOwnerValid(bool value) {
MutexSafeWrapper safeMutex(&mutexThreadOwnerValid);
threadOwnerValid = value;
safeMutex.ReleaseLock();
}
bool BaseThread::getThreadOwnerValid() {
bool ret = false;
MutexSafeWrapper safeMutex(&mutexThreadOwnerValid);
ret = threadOwnerValid;
safeMutex.ReleaseLock();
return ret;
}
void BaseThread::signalQuit() {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] uniqueID [%s]\n",__FILE__,__FUNCTION__,__LINE__,uniqueID.c_str());

View File

@@ -89,7 +89,7 @@ SimpleTaskThread::SimpleTaskThread( SimpleTaskCallbackInterface *simpleTaskInter
bool SimpleTaskThread::canShutdown(bool deleteSelfIfShutdownDelayed) {
bool ret = (getExecutingTask() == false);
if(deleteSelfIfShutdownDelayed == true) {
if(ret == false && deleteSelfIfShutdownDelayed == true) {
setDeleteSelfOnExecutionDone(deleteSelfIfShutdownDelayed);
signalQuit();
}

View File

@@ -753,6 +753,8 @@ Socket::Socket(PLATFORM_SOCKET sock) {
}
Socket::Socket() {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
this->pingThread = NULL;
this->connectedIpAddress = "";