mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +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:
@@ -24,7 +24,7 @@ class MySQL
|
||||
{
|
||||
mysql_thread_init();
|
||||
sLog->outSQLDriver("Core thread with ID [" UI64FMTD "] initializing MySQL thread.",
|
||||
(uint64)ACE_Based::Thread::currentId());
|
||||
ACORE::Thread::currentId());
|
||||
}
|
||||
|
||||
/*! Shuts down MySQL thread and frees resources, should only be called
|
||||
@@ -35,7 +35,7 @@ class MySQL
|
||||
{
|
||||
mysql_thread_end();
|
||||
sLog->outSQLDriver("Core thread with ID [" UI64FMTD "] shutting down MySQL thread.",
|
||||
(uint64)ACE_Based::Thread::currentId());
|
||||
ACORE::Thread::currentId());
|
||||
}
|
||||
|
||||
static void Library_Init()
|
||||
|
||||
@@ -80,14 +80,14 @@ int DelayExecutor::start(int num_threads, ACE_Method_Request* pre_svc_hook, ACE_
|
||||
queue_.queue()->activate();
|
||||
|
||||
// pussywizard:
|
||||
ACE_Based::ThreadPriority tp;
|
||||
int _priority = tp.getPriority(ACE_Based::Highest);
|
||||
if (ACE_Task_Base::activate(THR_NEW_LWP | THR_JOINABLE, num_threads, 0, _priority) == -1)
|
||||
return -1;
|
||||
|
||||
//if (ACE_Task_Base::activate(THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, num_threads) == -1)
|
||||
//ACORE::ThreadPriority tp;
|
||||
//int _priority = tp.getPriority(ACORE::Priority_Highest);
|
||||
//if (ACE_Task_Base::activate(THR_NEW_LWP | THR_JOINABLE, num_threads, 0, _priority) == -1)
|
||||
// return -1;
|
||||
|
||||
if (ACE_Task_Base::activate(THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED, num_threads) == -1)
|
||||
return -1;
|
||||
|
||||
activated(true);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -6,98 +6,23 @@
|
||||
|
||||
#include "Threading.h"
|
||||
#include "Errors.h"
|
||||
#include <ace/OS_NS_unistd.h>
|
||||
#include <ace/Sched_Params.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace ACE_Based;
|
||||
#include <chrono>
|
||||
#include <system_error>
|
||||
|
||||
ThreadPriority::ThreadPriority()
|
||||
using namespace ACORE;
|
||||
|
||||
Thread::Thread() : m_task(nullptr), m_iThreadId(), m_ThreadImp()
|
||||
{
|
||||
for (int i = Idle; i < MAXPRIORITYNUM; ++i)
|
||||
m_priority[i] = ACE_THR_PRI_OTHER_DEF;
|
||||
|
||||
m_priority[Idle] = ACE_Sched_Params::priority_min(ACE_SCHED_OTHER);
|
||||
m_priority[Realtime] = ACE_Sched_Params::priority_max(ACE_SCHED_OTHER);
|
||||
|
||||
std::vector<int> _tmp;
|
||||
|
||||
ACE_Sched_Params::Policy _policy = ACE_SCHED_OTHER;
|
||||
ACE_Sched_Priority_Iterator pr_iter(_policy);
|
||||
|
||||
while (pr_iter.more())
|
||||
{
|
||||
_tmp.push_back(pr_iter.priority());
|
||||
pr_iter.next();
|
||||
}
|
||||
|
||||
ASSERT (!_tmp.empty());
|
||||
|
||||
if (_tmp.size() >= MAXPRIORITYNUM)
|
||||
Thread::Thread(Runnable* instance) : m_task(instance), m_ThreadImp(&Thread::ThreadTask, (void*)m_task)
|
||||
{
|
||||
const size_t max_pos = _tmp.size();
|
||||
size_t min_pos = 1;
|
||||
size_t norm_pos = 0;
|
||||
for (size_t i = 0; i < max_pos; ++i)
|
||||
{
|
||||
if (_tmp[i] == ACE_THR_PRI_OTHER_DEF)
|
||||
{
|
||||
norm_pos = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_iThreadId = m_ThreadImp.get_id();
|
||||
|
||||
// since we have only 7(seven) values in enum Priority
|
||||
// and 3 we know already (Idle, Normal, Realtime) so
|
||||
// we need to split each list [Idle...Normal] and [Normal...Realtime]
|
||||
// into pieces
|
||||
const size_t _divider = 4;
|
||||
size_t _div = (norm_pos - min_pos) / _divider;
|
||||
if (_div == 0)
|
||||
_div = 1;
|
||||
|
||||
min_pos = (norm_pos - 1);
|
||||
|
||||
m_priority[Low] = _tmp[min_pos -= _div];
|
||||
m_priority[Lowest] = _tmp[min_pos -= _div ];
|
||||
|
||||
_div = (max_pos - norm_pos) / _divider;
|
||||
if (_div == 0)
|
||||
_div = 1;
|
||||
|
||||
min_pos = norm_pos - 1;
|
||||
|
||||
m_priority[High] = _tmp[min_pos += _div];
|
||||
m_priority[Highest] = _tmp[min_pos += _div];
|
||||
}
|
||||
}
|
||||
|
||||
int ThreadPriority::getPriority(Priority p) const
|
||||
{
|
||||
if (p < Idle)
|
||||
p = Idle;
|
||||
|
||||
if (p > Realtime)
|
||||
p = Realtime;
|
||||
|
||||
return m_priority[p];
|
||||
}
|
||||
|
||||
#define THREADFLAG (THR_NEW_LWP | THR_SCHED_DEFAULT| THR_JOINABLE)
|
||||
|
||||
Thread::Thread(): m_iThreadId(0), m_hThreadHandle(0), m_task(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Thread::Thread(Runnable* instance): m_iThreadId(0), m_hThreadHandle(0), m_task(instance)
|
||||
{
|
||||
// register reference to m_task to prevent it deeltion until destructor
|
||||
if (m_task)
|
||||
m_task->incReference();
|
||||
|
||||
bool _start = start();
|
||||
ASSERT (_start);
|
||||
}
|
||||
|
||||
Thread::~Thread()
|
||||
@@ -109,115 +34,72 @@ Thread::~Thread()
|
||||
m_task->decReference();
|
||||
}
|
||||
|
||||
//initialize Thread's class static member
|
||||
Thread::ThreadStorage Thread::m_ThreadStorage;
|
||||
ThreadPriority Thread::m_TpEnum;
|
||||
|
||||
bool Thread::start()
|
||||
bool Thread::wait()
|
||||
{
|
||||
if (m_task == 0 || m_iThreadId != 0)
|
||||
if (m_iThreadId == std::thread::id() || !m_task)
|
||||
return false;
|
||||
|
||||
// incRef before spawing the thread, otherwise Thread::ThreadTask() might call decRef and delete m_task
|
||||
m_task->incReference();
|
||||
bool res = true;
|
||||
|
||||
bool res = (ACE_Thread::spawn(&Thread::ThreadTask, (void*)m_task, THREADFLAG, &m_iThreadId, &m_hThreadHandle) == 0);
|
||||
try
|
||||
{
|
||||
m_ThreadImp.join();
|
||||
}
|
||||
catch (std::system_error&)
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
|
||||
if (!res)
|
||||
m_task->decReference();
|
||||
m_iThreadId = std::thread::id();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool Thread::wait()
|
||||
{
|
||||
if (!m_hThreadHandle || !m_task)
|
||||
return false;
|
||||
|
||||
ACE_THR_FUNC_RETURN _value = ACE_THR_FUNC_RETURN(-1);
|
||||
int _res = ACE_Thread::join(m_hThreadHandle, &_value);
|
||||
|
||||
m_iThreadId = 0;
|
||||
m_hThreadHandle = 0;
|
||||
|
||||
return (_res == 0);
|
||||
}
|
||||
|
||||
void Thread::destroy()
|
||||
{
|
||||
if (!m_iThreadId || !m_task)
|
||||
if (m_iThreadId == std::thread::id() || !m_task)
|
||||
return;
|
||||
|
||||
if (ACE_Thread::kill(m_iThreadId, -1) != 0)
|
||||
return;
|
||||
|
||||
m_iThreadId = 0;
|
||||
m_hThreadHandle = 0;
|
||||
|
||||
// reference set at ACE_Thread::spawn
|
||||
m_task->decReference();
|
||||
// FIXME: We need to make sure that all threads can be trusted to
|
||||
// halt execution on their own as this is not an interrupt
|
||||
m_ThreadImp.join();
|
||||
m_iThreadId = std::thread::id();
|
||||
}
|
||||
|
||||
void Thread::suspend()
|
||||
{
|
||||
ACE_Thread::suspend(m_hThreadHandle);
|
||||
}
|
||||
|
||||
void Thread::resume()
|
||||
{
|
||||
ACE_Thread::resume(m_hThreadHandle);
|
||||
}
|
||||
|
||||
ACE_THR_FUNC_RETURN Thread::ThreadTask(void * param)
|
||||
void Thread::ThreadTask(void* param)
|
||||
{
|
||||
Runnable* _task = (Runnable*)param;
|
||||
_task->run();
|
||||
|
||||
// task execution complete, free referecne added at
|
||||
_task->decReference();
|
||||
|
||||
return (ACE_THR_FUNC_RETURN)0;
|
||||
}
|
||||
|
||||
ACE_thread_t Thread::currentId()
|
||||
std::thread::id Thread::currentId()
|
||||
{
|
||||
return ACE_Thread::self();
|
||||
return std::this_thread::get_id();
|
||||
}
|
||||
|
||||
ACE_hthread_t Thread::currentHandle()
|
||||
void Thread::setPriority(Priority priority)
|
||||
{
|
||||
ACE_hthread_t _handle;
|
||||
ACE_Thread::self(_handle);
|
||||
std::thread::native_handle_type handle = m_ThreadImp.native_handle();
|
||||
bool _ok = true;
|
||||
#ifdef WIN32
|
||||
|
||||
return _handle;
|
||||
switch (priority)
|
||||
{
|
||||
case Priority_Realtime: _ok = SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL); break;
|
||||
case Priority_Highest: _ok = SetThreadPriority(handle, THREAD_PRIORITY_HIGHEST); break;
|
||||
case Priority_High: _ok = SetThreadPriority(handle, THREAD_PRIORITY_ABOVE_NORMAL); break;
|
||||
case Priority_Normal: _ok = SetThreadPriority(handle, THREAD_PRIORITY_NORMAL); break;
|
||||
case Priority_Low: _ok = SetThreadPriority(handle, THREAD_PRIORITY_BELOW_NORMAL); break;
|
||||
case Priority_Lowest: _ok = SetThreadPriority(handle, THREAD_PRIORITY_LOWEST); break;
|
||||
case Priority_Idle: _ok = SetThreadPriority(handle, THREAD_PRIORITY_IDLE); break;
|
||||
}
|
||||
#endif
|
||||
|
||||
Thread * Thread::current()
|
||||
{
|
||||
Thread * _thread = m_ThreadStorage.ts_object();
|
||||
if (!_thread)
|
||||
{
|
||||
_thread = new Thread();
|
||||
_thread->m_iThreadId = Thread::currentId();
|
||||
_thread->m_hThreadHandle = Thread::currentHandle();
|
||||
|
||||
Thread * _oldValue = m_ThreadStorage.ts_object(_thread);
|
||||
if (_oldValue)
|
||||
delete _oldValue;
|
||||
}
|
||||
|
||||
return _thread;
|
||||
}
|
||||
|
||||
void Thread::setPriority(Priority type)
|
||||
{
|
||||
int _priority = m_TpEnum.getPriority(type);
|
||||
int _ok = ACE_Thread::setprio(m_hThreadHandle, _priority);
|
||||
// remove this ASSERT in case you don't want to know is thread priority change was successful or not
|
||||
ASSERT (_ok == 0);
|
||||
ASSERT(_ok);
|
||||
}
|
||||
|
||||
void Thread::Sleep(unsigned long msecs)
|
||||
{
|
||||
ACE_OS::sleep(ACE_Time_Value(0, 1000 * msecs));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(msecs));
|
||||
}
|
||||
|
||||
@@ -7,16 +7,14 @@
|
||||
#ifndef THREADING_H
|
||||
#define THREADING_H
|
||||
|
||||
#include "Common.h"
|
||||
#include <ace/ACE.h>
|
||||
#include <ace/Thread.h>
|
||||
#include <ace/TSS_T.h>
|
||||
#include <ace/Atomic_Op.h>
|
||||
#include <assert.h>
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
namespace ACE_Based
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
namespace ACORE
|
||||
{
|
||||
|
||||
class Runnable
|
||||
{
|
||||
public:
|
||||
@@ -30,30 +28,18 @@ namespace ACE_Based
|
||||
delete this;
|
||||
}
|
||||
private:
|
||||
ACE_Atomic_Op<ACE_Thread_Mutex, long> m_refs;
|
||||
std::atomic_long m_refs;
|
||||
};
|
||||
|
||||
enum Priority
|
||||
{
|
||||
Idle,
|
||||
Lowest,
|
||||
Low,
|
||||
Normal,
|
||||
High,
|
||||
Highest,
|
||||
Realtime
|
||||
};
|
||||
|
||||
#define MAXPRIORITYNUM (Realtime + 1)
|
||||
|
||||
class ThreadPriority
|
||||
{
|
||||
public:
|
||||
ThreadPriority();
|
||||
int getPriority(Priority p) const;
|
||||
|
||||
private:
|
||||
int m_priority[MAXPRIORITYNUM];
|
||||
Priority_Idle,
|
||||
Priority_Lowest,
|
||||
Priority_Low,
|
||||
Priority_Normal,
|
||||
Priority_High,
|
||||
Priority_Highest,
|
||||
Priority_Realtime,
|
||||
};
|
||||
|
||||
class Thread
|
||||
@@ -63,36 +49,23 @@ namespace ACE_Based
|
||||
explicit Thread(Runnable* instance);
|
||||
~Thread();
|
||||
|
||||
bool start();
|
||||
bool wait();
|
||||
void destroy();
|
||||
|
||||
void suspend();
|
||||
void resume();
|
||||
|
||||
void setPriority(Priority type);
|
||||
|
||||
static void Sleep(unsigned long msecs);
|
||||
static ACE_thread_t currentId();
|
||||
static ACE_hthread_t currentHandle();
|
||||
static Thread * current();
|
||||
static std::thread::id currentId();
|
||||
|
||||
private:
|
||||
Thread(const Thread&);
|
||||
Thread& operator=(const Thread&);
|
||||
|
||||
static ACE_THR_FUNC_RETURN ThreadTask(void * param);
|
||||
static void ThreadTask(void* param);
|
||||
|
||||
ACE_thread_t m_iThreadId;
|
||||
ACE_hthread_t m_hThreadHandle;
|
||||
Runnable* m_task;
|
||||
|
||||
typedef ACE_TSS<Thread> ThreadStorage;
|
||||
//global object - container for Thread class representation of every thread
|
||||
static ThreadStorage m_ThreadStorage;
|
||||
//use this object to determine current OS thread priority values mapped to enum Priority{ }
|
||||
static ThreadPriority m_TpEnum;
|
||||
Runnable* const m_task;
|
||||
std::thread::id m_iThreadId;
|
||||
std::thread m_ThreadImp;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -134,7 +134,7 @@ typedef struct AuthHandler
|
||||
#endif
|
||||
|
||||
// Launch a thread to transfer a patch to the client
|
||||
class PatcherRunnable: public ACE_Based::Runnable
|
||||
class PatcherRunnable: public ACORE::Runnable
|
||||
{
|
||||
public:
|
||||
PatcherRunnable(class AuthSocket*);
|
||||
@@ -1010,7 +1010,7 @@ bool AuthSocket::_HandleXferResume()
|
||||
socket().recv((char*)&start, sizeof(start));
|
||||
fseek(pPatch, long(start), 0);
|
||||
|
||||
ACE_Based::Thread u(new PatcherRunnable(this));
|
||||
ACORE::Thread u(new PatcherRunnable(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1042,7 +1042,7 @@ bool AuthSocket::_HandleXferAccept()
|
||||
socket().recv_skip(1); // clear input buffer
|
||||
fseek(pPatch, 0, 0);
|
||||
|
||||
ACE_Based::Thread u(new PatcherRunnable(this));
|
||||
ACORE::Thread u(new PatcherRunnable(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include <ace/Singleton.h>
|
||||
#include <ace/Atomic_Op.h>
|
||||
#include <atomic>
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "DBCStores.h"
|
||||
@@ -1083,7 +1083,7 @@ class ScriptMgr
|
||||
uint32 _scriptCount;
|
||||
|
||||
//atomic op counter for active scripts amount
|
||||
ACE_Atomic_Op<ACE_Thread_Mutex, long> _scheduledScripts;
|
||||
std::atomic_long _scheduledScripts;
|
||||
};
|
||||
|
||||
template<class TScript>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define __CLIRUNNABLE_H
|
||||
|
||||
/// Command Line Interface handling thread
|
||||
class CliRunnable : public ACE_Based::Runnable
|
||||
class CliRunnable : public ACORE::Runnable
|
||||
{
|
||||
public:
|
||||
void run();
|
||||
|
||||
@@ -71,7 +71,7 @@ class WorldServerSignalHandler : public Trinity::SignalHandler
|
||||
}
|
||||
};
|
||||
|
||||
class FreezeDetectorRunnable : public ACE_Based::Runnable
|
||||
class FreezeDetectorRunnable : public ACORE::Runnable
|
||||
{
|
||||
private:
|
||||
uint32 _loops;
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
ACE_Based::Thread::Sleep(1000);
|
||||
ACORE::Thread::Sleep(1000);
|
||||
}
|
||||
sLog->outString("Anti-freeze thread exiting without problems.");
|
||||
}
|
||||
@@ -171,10 +171,10 @@ int Master::Run()
|
||||
//handle.register_handler(SIGSEGV, &signalSEGV);
|
||||
|
||||
///- Launch WorldRunnable thread
|
||||
ACE_Based::Thread worldThread(new WorldRunnable);
|
||||
worldThread.setPriority(ACE_Based::Highest);
|
||||
ACORE::Thread worldThread(new WorldRunnable);
|
||||
worldThread.setPriority(ACORE::Priority_Highest);
|
||||
|
||||
ACE_Based::Thread* cliThread = NULL;
|
||||
ACORE::Thread* cliThread = NULL;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
|
||||
@@ -183,14 +183,14 @@ int Master::Run()
|
||||
#endif
|
||||
{
|
||||
///- Launch CliRunnable thread
|
||||
cliThread = new ACE_Based::Thread(new CliRunnable);
|
||||
cliThread = new ACORE::Thread(new CliRunnable);
|
||||
}
|
||||
|
||||
ACE_Based::Thread rarThread(new RARunnable);
|
||||
ACORE::Thread rarThread(new RARunnable);
|
||||
|
||||
// pussywizard:
|
||||
ACE_Based::Thread auctionLising_thread(new AuctionListingRunnable);
|
||||
auctionLising_thread.setPriority(ACE_Based::High);
|
||||
ACORE::Thread auctionLising_thread(new AuctionListingRunnable);
|
||||
auctionLising_thread.setPriority(ACORE::Priority_High);
|
||||
|
||||
#if defined(_WIN32) || defined(__linux__)
|
||||
|
||||
@@ -262,21 +262,21 @@ int Master::Run()
|
||||
#endif
|
||||
|
||||
// Start soap serving thread
|
||||
ACE_Based::Thread* soapThread = NULL;
|
||||
ACORE::Thread* soapThread = NULL;
|
||||
if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false))
|
||||
{
|
||||
TCSoapRunnable* runnable = new TCSoapRunnable();
|
||||
runnable->SetListenArguments(sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878)));
|
||||
soapThread = new ACE_Based::Thread(runnable);
|
||||
soapThread = new ACORE::Thread(runnable);
|
||||
}
|
||||
|
||||
// Start up freeze catcher thread
|
||||
ACE_Based::Thread* freezeThread = NULL;
|
||||
ACORE::Thread* freezeThread = NULL;
|
||||
if (uint32 freezeDelay = sConfigMgr->GetIntDefault("MaxCoreStuckTime", 0))
|
||||
{
|
||||
FreezeDetectorRunnable* runnable = new FreezeDetectorRunnable(freezeDelay*1000);
|
||||
freezeThread = new ACE_Based::Thread(runnable);
|
||||
freezeThread->setPriority(ACE_Based::Highest);
|
||||
freezeThread = new ACORE::Thread(runnable);
|
||||
freezeThread->setPriority(ACORE::Priority_Highest);
|
||||
}
|
||||
|
||||
///- Launch the world listener socket
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <ace/Reactor.h>
|
||||
|
||||
class RARunnable : public ACE_Based::Runnable
|
||||
class RARunnable : public ACORE::Runnable
|
||||
{
|
||||
public:
|
||||
RARunnable();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <ace/Task.h>
|
||||
#include <Threading.h>
|
||||
|
||||
class TCSoapRunnable : public ACE_Based::Runnable
|
||||
class TCSoapRunnable : public ACORE::Runnable
|
||||
{
|
||||
public:
|
||||
TCSoapRunnable() : _port(0) { }
|
||||
|
||||
@@ -51,7 +51,7 @@ void WorldRunnable::run()
|
||||
avgDiffTracker.Update(executionTimeDiff > WORLD_SLEEP_CONST ? executionTimeDiff : WORLD_SLEEP_CONST);
|
||||
|
||||
if (executionTimeDiff < WORLD_SLEEP_CONST)
|
||||
ACE_Based::Thread::Sleep(WORLD_SLEEP_CONST-executionTimeDiff);
|
||||
ACORE::Thread::Sleep(WORLD_SLEEP_CONST-executionTimeDiff);
|
||||
|
||||
#ifdef _WIN32
|
||||
if (m_ServiceStatus == 0)
|
||||
@@ -118,7 +118,7 @@ void AuctionListingRunnable::run()
|
||||
}
|
||||
}
|
||||
}
|
||||
ACE_Based::Thread::Sleep(1);
|
||||
ACORE::Thread::Sleep(1);
|
||||
}
|
||||
sLog->outString("Auction House Listing thread exiting without problems.");
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
#define __WORLDRUNNABLE_H
|
||||
|
||||
/// Heartbeat thread for the World
|
||||
class WorldRunnable : public ACE_Based::Runnable
|
||||
class WorldRunnable : public ACORE::Runnable
|
||||
{
|
||||
public:
|
||||
void run();
|
||||
};
|
||||
|
||||
class AuctionListingRunnable : public ACE_Based::Runnable
|
||||
class AuctionListingRunnable : public ACORE::Runnable
|
||||
{
|
||||
public:
|
||||
void run();
|
||||
|
||||
Reference in New Issue
Block a user