Revert Platform::setProcessPriority

This commit is contained in:
XMRig 2019-12-27 03:19:03 +07:00
parent dbb721cb5e
commit 4a9a7434f6
No known key found for this signature in database
GPG key ID: 446A53638BE94409
5 changed files with 49 additions and 0 deletions

View file

@ -131,6 +131,43 @@ void xmrig::Platform::restoreTimerResolution()
}
void xmrig::Platform::setProcessPriority(int priority)
{
if (priority == -1) {
return;
}
DWORD prio = IDLE_PRIORITY_CLASS;
switch (priority)
{
case 1:
prio = BELOW_NORMAL_PRIORITY_CLASS;
break;
case 2:
prio = NORMAL_PRIORITY_CLASS;
break;
case 3:
prio = ABOVE_NORMAL_PRIORITY_CLASS;
break;
case 4:
prio = HIGH_PRIORITY_CLASS;
break;
case 5:
prio = REALTIME_PRIORITY_CLASS;
break;
default:
break;
}
SetPriorityClass(GetCurrentProcess(), prio);
}
void xmrig::Platform::setThreadPriority(int priority)
{
if (priority == -1) {