diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-06-08 01:21:17 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-06-08 01:21:17 +0200 |
commit | 73e90f62411a4f507ae210ab20f78ce81af13b93 (patch) | |
tree | a4ab0fa6845ef84bd885da0b963395f67415093e /src/server/worldserver/Master.cpp | |
parent | f53045ae5c880ff5fbb75cfe0bd51bb5bbade655 (diff) | |
parent | 27b5e0d9ac20f7bc1a061e22ae923483bcf4f8db (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/worldserver/Master.cpp')
-rw-r--r-- | src/server/worldserver/Master.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index c5424374f5a..6e4214603cb 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -201,24 +201,24 @@ int Master::Run() ACE_Based::Thread rarThread(new RARunnable); #if defined(_WIN32) || defined(__linux__) - + ///- Handle affinity for multiple processors and process priority uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0); bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false); #ifdef _WIN32 // Windows - + HANDLE hProcess = GetCurrentProcess(); - + if (affinity > 0) { ULONG_PTR appAff; ULONG_PTR sysAff; - + if (GetProcessAffinityMask(hProcess, &appAff, &sysAff)) { ULONG_PTR currentAffinity = affinity & appAff; // remove non accessible processors - + if (!currentAffinity) TC_LOG_ERROR("server.worldserver", "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", affinity, appAff); else if (SetProcessAffinityMask(hProcess, currentAffinity)) @@ -227,7 +227,7 @@ int Master::Run() TC_LOG_ERROR("server.worldserver", "Can't set used processors (hex): %x", currentAffinity); } } - + if (highPriority) { if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) @@ -235,9 +235,9 @@ int Master::Run() else TC_LOG_ERROR("server.worldserver", "Can't set worldserver process priority class."); } - + #else // Linux - + if (affinity > 0) { cpu_set_t mask; @@ -264,7 +264,7 @@ int Master::Run() else TC_LOG_INFO("server.worldserver", "worldserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); } - + #endif #endif |