mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 01:23:47 +00:00
Rewritten Threading system using c++11 std instead of ACE
It also allow full compilation with clang under all supported platforms Need tests
This commit is contained in:
@@ -344,10 +344,10 @@ class WorldSession
|
||||
void SetLatency(uint32 latency) { m_latency = latency; }
|
||||
void ResetClientTimeDelay() { m_clientTimeDelay = 0; }
|
||||
|
||||
ACE_Atomic_Op<ACE_Thread_Mutex, time_t> m_timeOutTime;
|
||||
std::atomic<time_t> m_timeOutTime;
|
||||
void UpdateTimeOutTime(uint32 diff)
|
||||
{
|
||||
if (time_t(diff) > m_timeOutTime.value())
|
||||
if (time_t(diff) > m_timeOutTime)
|
||||
m_timeOutTime = 0;
|
||||
else
|
||||
m_timeOutTime -= diff;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <ace/TP_Reactor.h>
|
||||
#include <ace/Dev_Poll_Reactor.h>
|
||||
#include <ace/Guard_T.h>
|
||||
#include <ace/Atomic_Op.h>
|
||||
#include <atomic>
|
||||
#include <ace/os_include/arpa/os_inet.h>
|
||||
#include <ace/os_include/netinet/os_tcp.h>
|
||||
#include <ace/os_include/sys/os_types.h>
|
||||
@@ -92,7 +92,7 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
|
||||
long Connections()
|
||||
{
|
||||
return static_cast<long> (m_Connections.value());
|
||||
return static_cast<long> (m_Connections);
|
||||
}
|
||||
|
||||
int AddSocket (WorldSocket* sock)
|
||||
@@ -186,7 +186,7 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
}
|
||||
|
||||
private:
|
||||
typedef ACE_Atomic_Op<ACE_SYNCH_MUTEX, long> AtomicInt;
|
||||
typedef std::atomic_long AtomicInt;
|
||||
typedef std::set<WorldSocket*> SocketSet;
|
||||
|
||||
ACE_Reactor* m_Reactor;
|
||||
|
||||
Reference in New Issue
Block a user