Removed mtmaps OpenMP

Implement mtmaps based on ACE
For stable work MapUpdate.Threads=2 in config

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-17 07:34:00 +01:00
parent 8507b7da99
commit 2028f0658b
16 changed files with 371 additions and 94 deletions
+6 -1
View File
@@ -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;
}