diff options
author | n0n4m3 <none@none> | 2009-12-17 07:34:00 +0100 |
---|---|---|
committer | n0n4m3 <none@none> | 2009-12-17 07:34:00 +0100 |
commit | 2028f0658b2bb95e2390aba8fd995271fe4e41d6 (patch) | |
tree | 0b468a4234b90588e7b7e799b7581b57800add2d /src/game/ObjectAccessor.h | |
parent | 8507b7da9902303189e9d01c8c23d1aaf8d656bd (diff) |
Removed mtmaps OpenMP
Implement mtmaps based on ACE
For stable work MapUpdate.Threads=2 in config
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectAccessor.h')
-rw-r--r-- | src/game/ObjectAccessor.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index 67ef5efef89..79afa78fb6a 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -52,7 +52,11 @@ class HashMapHolder typedef ACE_Thread_Mutex LockType; typedef MaNGOS::GeneralLock<LockType > Guard; - static void Insert(T* o) { m_objectMap[o->GetGUID()] = o; } + static void Insert(T* o) + { + Guard guard(i_lock); + m_objectMap[o->GetGUID()] = o; + } static void Remove(T* o) { @@ -62,6 +66,7 @@ class HashMapHolder static T* Find(uint64 guid) { + Guard guard(i_lock); typename MapType::iterator itr = m_objectMap.find(guid); return (itr != m_objectMap.end()) ? itr->second : NULL; } |