mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[7810] Moved ZThread related code on ACE framework.
Remove ZThread source code from mangos. Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
parent
f117ce3420
commit
2aff48cc5d
182 changed files with 684 additions and 21041 deletions
|
|
@ -58,7 +58,7 @@ INSTANTIATE_SINGLETON_1( Master );
|
|||
|
||||
volatile uint32 Master::m_masterLoopCounter = 0;
|
||||
|
||||
class FreezeDetectorRunnable : public ZThread::Runnable
|
||||
class FreezeDetectorRunnable : public ACE_Based::Runnable
|
||||
{
|
||||
public:
|
||||
FreezeDetectorRunnable() { _delaytime = 0; }
|
||||
|
|
@ -77,7 +77,8 @@ public:
|
|||
w_lastchange = 0;
|
||||
while(!World::IsStopped())
|
||||
{
|
||||
ZThread::Thread::sleep(1000);
|
||||
ACE_Based::Thread::Sleep(1000);
|
||||
|
||||
uint32 curtime = getMSTime();
|
||||
//DEBUG_LOG("anti-freeze: time=%u, counters=[%u; %u]",curtime,Master::m_masterLoopCounter,World::m_worldLoopCounter);
|
||||
|
||||
|
|
@ -113,7 +114,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class RARunnable : public ZThread::Runnable
|
||||
class RARunnable : public ACE_Based::Runnable
|
||||
{
|
||||
public:
|
||||
uint32 numLoops, loopCounter;
|
||||
|
|
@ -179,7 +180,7 @@ public:
|
|||
{
|
||||
while (!World::IsStopped())
|
||||
{
|
||||
ZThread::Thread::sleep (static_cast<unsigned long> (socketSelecttime / 1000));
|
||||
ACE_Based::Thread::Sleep(static_cast<unsigned long> (socketSelecttime / 1000));
|
||||
checkping ();
|
||||
}
|
||||
}
|
||||
|
|
@ -222,8 +223,8 @@ int Master::Run()
|
|||
_HookSignals();
|
||||
|
||||
///- Launch WorldRunnable thread
|
||||
ZThread::Thread t(new WorldRunnable);
|
||||
t.setPriority ((ZThread::Priority )2);
|
||||
ACE_Based::Thread t(*new WorldRunnable);
|
||||
t.setPriority(ACE_Based::Highest);
|
||||
|
||||
// set server online
|
||||
loginDatabase.PExecute("UPDATE realmlist SET color = 0, population = 0 WHERE id = '%d'",realmID);
|
||||
|
|
@ -235,10 +236,10 @@ int Master::Run()
|
|||
#endif
|
||||
{
|
||||
///- Launch CliRunnable thread
|
||||
ZThread::Thread td1(new CliRunnable);
|
||||
ACE_Based::Thread td1(*new CliRunnable);
|
||||
}
|
||||
|
||||
ZThread::Thread td2(new RARunnable);
|
||||
ACE_Based::Thread td2(*new RARunnable);
|
||||
|
||||
///- Handle affinity for multiple processors and process priority on Windows
|
||||
#ifdef WIN32
|
||||
|
|
@ -299,8 +300,8 @@ int Master::Run()
|
|||
{
|
||||
FreezeDetectorRunnable *fdr = new FreezeDetectorRunnable();
|
||||
fdr->SetDelayTime(freeze_delay*1000);
|
||||
ZThread::Thread t(fdr);
|
||||
t.setPriority(ZThread::High);
|
||||
ACE_Based::Thread t(*fdr);
|
||||
t.setPriority(ACE_Based::Highest);
|
||||
}
|
||||
|
||||
///- Launch the world listener socket
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue