mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 15:11:20 +02:00
- numerous thread bugfixes related to menu stability and ftp server socket usage
This commit is contained in:
@@ -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());
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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 = "";
|
||||
|
||||
|
Reference in New Issue
Block a user