mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 13:50:43 +02:00
attempt to fix a thread bug when starting a game
This commit is contained in:
@@ -976,22 +976,12 @@ void MenuStateConnectedGame::simpleTask(BaseThread *callingThread) {
|
|||||||
|
|
||||||
Lang &lang= Lang::getInstance();
|
Lang &lang= Lang::getInstance();
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
// string fileArchiveExtractCommand = config.getString("FileArchiveExtractCommand","");
|
|
||||||
// int expectedResult = config.getInt("FileArchiveExtractCommandSuccessResult","0");
|
|
||||||
// bool findArchive = executeShellCommand(fileArchiveExtractCommand,expectedResult);
|
|
||||||
// if(findArchive == false) {
|
|
||||||
// mainMessageBoxState = ftpmsg_None;
|
|
||||||
// mainMessageBox.init(lang.get("Ok"),450);
|
|
||||||
// showMessageBox(lang.get("ModRequires7z"), lang.get("Notice"), true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
std::string techsMetaData = "";
|
std::string techsMetaData = "";
|
||||||
std::string tilesetsMetaData = "";
|
std::string tilesetsMetaData = "";
|
||||||
std::string mapsMetaData = "";
|
std::string mapsMetaData = "";
|
||||||
std::string scenariosMetaData = "";
|
std::string scenariosMetaData = "";
|
||||||
|
|
||||||
//modMenuState=mmst_Loading;
|
|
||||||
|
|
||||||
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__);
|
||||||
|
|
||||||
if(config.getString("Masterserver","") != "") {
|
if(config.getString("Masterserver","") != "") {
|
||||||
@@ -1005,6 +995,7 @@ void MenuStateConnectedGame::simpleTask(BaseThread *callingThread) {
|
|||||||
CURL *handle = SystemFlags::initHTTP();
|
CURL *handle = SystemFlags::initHTTP();
|
||||||
CURLcode curlResult = CURLE_OK;
|
CURLcode curlResult = CURLE_OK;
|
||||||
techsMetaData = SystemFlags::getHTTP(baseURL + "showTechsForGlest.php"+phpVersionParam+gameVersion+playerUUID,handle,-1,&curlResult);
|
techsMetaData = SystemFlags::getHTTP(baseURL + "showTechsForGlest.php"+phpVersionParam+gameVersion+playerUUID,handle,-1,&curlResult);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("techsMetaData [%s] curlResult = %d\n",techsMetaData.c_str(),curlResult);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("techsMetaData [%s] curlResult = %d\n",techsMetaData.c_str(),curlResult);
|
||||||
|
|
||||||
if(callingThread->getQuitStatus() == true || safeMutexThreadOwner.isValidMutex() == false) {
|
if(callingThread->getQuitStatus() == true || safeMutexThreadOwner.isValidMutex() == false) {
|
||||||
@@ -1167,8 +1158,6 @@ void MenuStateConnectedGame::simpleTask(BaseThread *callingThread) {
|
|||||||
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__);
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//modMenuState=mmst_None;
|
|
||||||
|
|
||||||
if(modHttpServerThread != NULL) {
|
if(modHttpServerThread != NULL) {
|
||||||
modHttpServerThread->signalQuit();
|
modHttpServerThread->signalQuit();
|
||||||
}
|
}
|
||||||
@@ -2304,6 +2293,8 @@ void MenuStateConnectedGame::returnToJoinMenu() {
|
|||||||
if(modHttpServerThread != NULL) {
|
if(modHttpServerThread != NULL) {
|
||||||
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__);
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
modHttpServerThread->setSimpleTaskInterfaceValid(false);
|
||||||
modHttpServerThread->signalQuit();
|
modHttpServerThread->signalQuit();
|
||||||
//modHttpServerThread->setThreadOwnerValid(false);
|
//modHttpServerThread->setThreadOwnerValid(false);
|
||||||
|
|
||||||
@@ -3369,6 +3360,7 @@ void MenuStateConnectedGame::update() {
|
|||||||
if(modHttpServerThread != NULL) {
|
if(modHttpServerThread != NULL) {
|
||||||
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__);
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
modHttpServerThread->setSimpleTaskInterfaceValid(false);
|
||||||
modHttpServerThread->signalQuit();
|
modHttpServerThread->signalQuit();
|
||||||
//modHttpServerThread->setThreadOwnerValid(false);
|
//modHttpServerThread->setThreadOwnerValid(false);
|
||||||
|
|
||||||
|
@@ -117,8 +117,8 @@ public:
|
|||||||
|
|
||||||
void setOverrideShutdownTask(taskFunctionCallback *ptr);
|
void setOverrideShutdownTask(taskFunctionCallback *ptr);
|
||||||
|
|
||||||
bool getSimpleTaskInterfaceValid() const { return this->simpleTaskInterfaceValid; }
|
bool getSimpleTaskInterfaceValid();
|
||||||
void setSimpleTaskInterfaceValid(bool value) { this->simpleTaskInterfaceValid = value; }
|
void setSimpleTaskInterfaceValid(bool value);
|
||||||
};
|
};
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
@@ -427,6 +427,19 @@ bool SimpleTaskThread::canShutdown(bool deleteSelfIfShutdownDelayed) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SimpleTaskThread::getSimpleTaskInterfaceValid() {
|
||||||
|
string mutexOwnerId1 = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
MutexSafeWrapper safeMutex1(&mutexSimpleTaskInterfaceValid,mutexOwnerId1);
|
||||||
|
|
||||||
|
return this->simpleTaskInterfaceValid;
|
||||||
|
}
|
||||||
|
void SimpleTaskThread::setSimpleTaskInterfaceValid(bool value) {
|
||||||
|
string mutexOwnerId1 = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||||
|
MutexSafeWrapper safeMutex1(&mutexSimpleTaskInterfaceValid,mutexOwnerId1);
|
||||||
|
|
||||||
|
this->simpleTaskInterfaceValid = value;
|
||||||
|
}
|
||||||
|
|
||||||
void SimpleTaskThread::execute() {
|
void SimpleTaskThread::execute() {
|
||||||
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__);
|
||||||
void *ptr_cpy = this->ptr;
|
void *ptr_cpy = this->ptr;
|
||||||
|
Reference in New Issue
Block a user