Merge pull request #348 from WarheadCore/mutex

feat(GlobalMethods/AzerothCore): switch to new threading system
This commit is contained in:
Rochet2
2021-04-16 21:25:53 +03:00
committed by GitHub
2 changed files with 4 additions and 6 deletions

View File

@@ -10,7 +10,9 @@
#include "BindingMap.h" #include "BindingMap.h"
#ifdef AZEROTHCORE #ifdef AZEROTHCORE
#include "BanManager.h" #include "BanManager.h"
enum BanMode enum BanMode
{ {
BAN_ACCOUNT = 1, BAN_ACCOUNT = 1,
@@ -198,10 +200,8 @@ namespace LuaGlobalFunctions
}); });
#else #else
{ {
#ifdef TRINITY #if defined TRINITY || AZEROTHCORE
std::shared_lock<std::shared_mutex> lock(*HashMapHolder<Player>::GetLock()); std::shared_lock<std::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
#elif defined(AZEROTHCORE)
ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
#else #else
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock()); HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
#endif #endif

View File

@@ -36,10 +36,8 @@ namespace LuaGuild
}); });
#else #else
{ {
#ifdef TRINITY #if defined TRINITY || AZEROTHCORE
std::shared_lock<std::shared_mutex> lock(*HashMapHolder<Player>::GetLock()); std::shared_lock<std::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
#elif defined(AZEROTHCORE)
ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
#else #else
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock()); HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
#endif #endif