aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/Master.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2014-06-23 16:35:54 -0500
committerSubv <subv2112@gmail.com>2014-06-23 16:35:54 -0500
commit0db743c4ff2885ae51319c897158cc8774b41a88 (patch)
tree06b1e7950dac31b879ae7802d40b7493b0c61ec4 /src/server/worldserver/Master.cpp
parent28b61812cf0d87b84aefaa0889844b6288f93b93 (diff)
parentaa93a975469cca56e35adc1b5b501f4536be61f1 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into boost
Conflicts: src/server/authserver/Server/AuthSession.cpp src/server/game/Server/WorldSession.h src/server/shared/Packets/ByteBuffer.cpp src/server/shared/Utilities/Util.h
Diffstat (limited to 'src/server/worldserver/Master.cpp')
-rw-r--r--src/server/worldserver/Master.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index 765ab0f09a6..2a8fcdd431a 100644
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -187,24 +187,24 @@ int Master::Run()
// std::thread rarThread(RemoteAccessThread);
#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))
@@ -213,7 +213,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))
@@ -221,9 +221,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;
@@ -250,7 +250,7 @@ int Master::Run()
else
TC_LOG_INFO("server.worldserver", "worldserver process priority class set to %i", getpriority(PRIO_PROCESS, 0));
}
-
+
#endif
#endif