mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
feat(Core/Threading): replace ace threading (#4821)
This commit is contained in:
@@ -199,13 +199,13 @@ MapEntry const* InstanceSave::GetMapEntry()
|
||||
|
||||
void InstanceSave::AddPlayer(uint32 guidLow)
|
||||
{
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _lock);
|
||||
std::lock_guard<std::mutex> guard(_lock);
|
||||
m_playerList.push_back(guidLow);
|
||||
}
|
||||
|
||||
bool InstanceSave::RemovePlayer(uint32 guidLow, InstanceSaveManager* ism)
|
||||
{
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _lock);
|
||||
std::lock_guard<std::mutex> guard(_lock);
|
||||
m_playerList.remove(guidLow);
|
||||
|
||||
// ism passed as an argument to avoid calling via singleton (might result in a deadlock)
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
#include "DBCEnums.h"
|
||||
#include "Define.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include <ace/Null_Mutex.h>
|
||||
#include <ace/Thread_Mutex.h>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
struct InstanceTemplate;
|
||||
@@ -88,7 +87,7 @@ private:
|
||||
std::string m_instanceData;
|
||||
uint32 m_completedEncounterMask;
|
||||
|
||||
ACE_Thread_Mutex _lock;
|
||||
std::mutex _lock;
|
||||
};
|
||||
|
||||
typedef std::unordered_map<uint32 /*PAIR32(map, difficulty)*/, time_t /*resetTime*/> ResetTimeByMapDifficultyMap;
|
||||
|
||||
Reference in New Issue
Block a user