diff options
| author | leak <leak@bitmx.net> | 2014-07-02 02:20:53 +0200 |
|---|---|---|
| committer | leak <leak@bitmx.net> | 2014-07-02 02:20:53 +0200 |
| commit | e0aed65c8ce46053b078bce0ea237db249e5b1dc (patch) | |
| tree | c79299308fa8eed9e9b35efe01ce5023cb2da928 /src/server/game/World | |
| parent | 66c94ce965b763a3c144c0e542e7329a24a3a2e3 (diff) | |
ACE cleanup on game, now the major issue remains WorldSocket
Diffstat (limited to 'src/server/game/World')
| -rw-r--r-- | src/server/game/World/World.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/World/World.h | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 4a46412dff7..d917030bb19 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -20,6 +20,7 @@ \ingroup world */ +#include <atomic> #include "Common.h" #include "Memory.h" #include "DatabaseEnv.h" @@ -81,9 +82,10 @@ #include "BattlefieldMgr.h" #include "TransportMgr.h" -ACE_Atomic_Op<ACE_Thread_Mutex, bool> World::m_stopEvent = false; + +std::atomic<bool> World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; -ACE_Atomic_Op<ACE_Thread_Mutex, uint32> World::m_worldLoopCounter = 0; +std::atomic_uint32_t World::m_worldLoopCounter = 0; float World::m_MaxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE; float World::m_MaxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE; @@ -2590,7 +2592,7 @@ void World::ShutdownMsg(bool show, Player* player) void World::ShutdownCancel() { // nothing cancel or too later - if (!m_ShutdownTimer || m_stopEvent.value()) + if (!m_ShutdownTimer || m_stopEvent) return; ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index f9528c793f7..cdffbf3ee2a 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -25,11 +25,11 @@ #include "Common.h" #include "Timer.h" -#include <ace/Atomic_Op.h> #include "SharedDefines.h" #include "QueryResult.h" #include "Callback.h" +#include <atomic> #include <map> #include <set> #include <list> @@ -523,7 +523,7 @@ class World return instance; } - static ACE_Atomic_Op<ACE_Thread_Mutex, uint32> m_worldLoopCounter; + static std::atomic_uint32_t m_worldLoopCounter; WorldSession* FindSession(uint32 id) const; void AddSession(WorldSession* s); @@ -636,7 +636,7 @@ class World void ShutdownMsg(bool show = false, Player* player = NULL); static uint8 GetExitCode() { return m_ExitCode; } static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; } - static bool IsStopped() { return m_stopEvent.value(); } + static bool IsStopped() { return m_stopEvent; } void Update(uint32 diff); @@ -761,7 +761,7 @@ class World World(); ~World(); - static ACE_Atomic_Op<ACE_Thread_Mutex, bool> m_stopEvent; + static std::atomic<bool> m_stopEvent; static uint8 m_ExitCode; uint32 m_ShutdownTimer; uint32 m_ShutdownMask; |
