feat(Core/Threading): replace ace threading (#4821)

This commit is contained in:
Kargatum
2021-04-17 00:45:29 +07:00
committed by GitHub
parent b9e84d8278
commit b2861be1cd
50 changed files with 300 additions and 342 deletions

View File

@@ -250,7 +250,7 @@ void MotionTransport::UpdatePosition(float x, float y, float z, float o)
void MotionTransport::AddPassenger(WorldObject* passenger, bool withAll)
{
ACORE_GUARD(ACE_Thread_Mutex, Lock);
std::lock_guard<std::mutex> guard(Lock);
if (_passengers.insert(passenger).second)
{
if (Player* plr = passenger->ToPlayer())
@@ -279,7 +279,7 @@ void MotionTransport::AddPassenger(WorldObject* passenger, bool withAll)
void MotionTransport::RemovePassenger(WorldObject* passenger, bool withAll)
{
ACORE_GUARD(ACE_Thread_Mutex, Lock);
std::lock_guard<std::mutex> guard(Lock);
if (_passengers.erase(passenger) || _staticPassengers.erase(passenger))
{
if (Player* plr = passenger->ToPlayer())

View File

@@ -91,7 +91,7 @@ private:
bool _triggeredDepartureEvent;
PassengerSet _staticPassengers;
mutable ACE_Thread_Mutex Lock;
mutable std::mutex Lock;
bool _passengersLoaded;
bool _delayedTeleport;
};