mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
feat(Core/Threading): replace ace threading (#4821)
This commit is contained in:
@@ -5815,8 +5815,8 @@ void Player::ClearChannelWatch()
|
||||
void Player::UpdateLocalChannels(uint32 newZone)
|
||||
{
|
||||
// pussywizard: mutex needed (tc changed opcode to THREAD UNSAFE)
|
||||
static ACE_Thread_Mutex channelsLock;
|
||||
ACORE_GUARD(ACE_Thread_Mutex, channelsLock);
|
||||
static std::mutex channelsLock;
|
||||
std::lock_guard<std::mutex> guard(channelsLock);
|
||||
|
||||
if (GetSession()->PlayerLoading() && !IsBeingTeleportedFar())
|
||||
return; // The client handles it automatically after loading, but not after teleporting
|
||||
@@ -14361,7 +14361,7 @@ void Player::TradeCancel(bool sendback)
|
||||
|
||||
void Player::UpdateSoulboundTradeItems()
|
||||
{
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
std::lock_guard<std::mutex> guard(m_soulboundTradableLock);
|
||||
if (m_itemSoulboundTradeable.empty())
|
||||
return;
|
||||
|
||||
@@ -14385,14 +14385,14 @@ void Player::UpdateSoulboundTradeItems()
|
||||
|
||||
void Player::AddTradeableItem(Item* item)
|
||||
{
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
std::lock_guard<std::mutex> guard(m_soulboundTradableLock);
|
||||
m_itemSoulboundTradeable.push_back(item);
|
||||
}
|
||||
|
||||
//TODO: should never allow an item to be added to m_itemSoulboundTradeable twice
|
||||
void Player::RemoveTradeableItem(Item* item)
|
||||
{
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
std::lock_guard<std::mutex> guard(m_soulboundTradableLock);
|
||||
m_itemSoulboundTradeable.remove(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user