From 4c3c418511fdfcc9fc7a7e17d66df337792ed056 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 26 Nov 2011 19:11:58 +0100 Subject: Core/Misc: Make VMapManager2::acquireModelInstance and releaseModelInstance thread safe Closes #4086 --- src/server/collision/Management/VMapManager2.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server/collision/Management/VMapManager2.cpp') diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 9f32c749c5c..0632542f82e 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -247,6 +247,9 @@ namespace VMAP WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename) { + //! Critical section, thread safe access to iLoadedModelFiles + TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock); + ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { @@ -267,6 +270,9 @@ namespace VMAP void VMapManager2::releaseModelInstance(const std::string &filename) { + //! Critical section, thread safe access to iLoadedModelFiles + TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock); + ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { -- cgit v1.2.3