mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 11:19:48 +02:00
- mutex change to make simple thread usage in custom menu more stable
This commit is contained in:
@@ -1096,7 +1096,7 @@ void MenuStateCustomGame::simpleTask() {
|
|||||||
needToRepublishToMasterserver = false;
|
needToRepublishToMasterserver = false;
|
||||||
string newPublishToServerInfo = publishToServerInfo;
|
string newPublishToServerInfo = publishToServerInfo;
|
||||||
publishToServerInfo = "";
|
publishToServerInfo = "";
|
||||||
safeMutex.ReleaseLock(true);
|
//safeMutex.ReleaseLock(true);
|
||||||
|
|
||||||
if(republish == true) {
|
if(republish == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
@@ -1117,22 +1117,22 @@ void MenuStateCustomGame::simpleTask() {
|
|||||||
// uncomment to enable router setup check of this server
|
// uncomment to enable router setup check of this server
|
||||||
//if(serverInfo!="OK")
|
//if(serverInfo!="OK")
|
||||||
if(EndsWith(serverInfo, "OK") == false) {
|
if(EndsWith(serverInfo, "OK") == false) {
|
||||||
safeMutex.Lock();
|
//safeMutex.Lock();
|
||||||
showMasterserverError=true;
|
showMasterserverError=true;
|
||||||
masterServererErrorToShow=serverInfo;
|
masterServererErrorToShow=serverInfo;
|
||||||
safeMutex.ReleaseLock(true);
|
//safeMutex.ReleaseLock(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
safeMutex.Lock();
|
//safeMutex.Lock();
|
||||||
bool broadCastSettings = needToBroadcastServerSettings;
|
bool broadCastSettings = needToBroadcastServerSettings;
|
||||||
if(publishToMasterserverThread == NULL || publishToMasterserverThread->getQuitStatus() == true || publishToMasterserverThread->getRunningStatus() == false) {
|
if(publishToMasterserverThread == NULL || publishToMasterserverThread->getQuitStatus() == true || publishToMasterserverThread->getRunningStatus() == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
needToBroadcastServerSettings=false;
|
needToBroadcastServerSettings=false;
|
||||||
safeMutex.ReleaseLock(true);
|
//safeMutex.ReleaseLock(true);
|
||||||
|
|
||||||
if(broadCastSettings) {
|
if(broadCastSettings) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
Reference in New Issue
Block a user