Fix a crash related to concurrent access to config file by different threads.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-08-15 16:55:44 +02:00
parent 96144752be
commit e8d03e55ca
2 changed files with 5 additions and 0 deletions

View File

@@ -26,6 +26,8 @@ static bool GetValueHelper(ACE_Configuration_Heap *mConf, const char *name, ACE_
if (!mConf)
return false;
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, sConfig.mMtx, false);
ACE_TString section_name;
ACE_Configuration_Section_Key section_key;
ACE_Configuration_Section_Key root_key = mConf->root_section();

View File

@@ -43,6 +43,9 @@ class Config
float GetFloatDefault(const char * name, const float def);
std::string GetFilename() const { return mFilename; }
ACE_Thread_Mutex mMtx;
private:
std::string mFilename;
ACE_Configuration_Heap *mConf;