1
0
mirror of https://github.com/GOSTSec/ccminer synced 2025-03-09 20:11:11 +00:00

cpu-priority: fix for windows process

This commit is contained in:
Tanguy Pruvot 2015-01-22 03:08:41 +01:00
parent c3b6162899
commit 65cefa4a7d

View File

@ -2276,6 +2276,24 @@ int main(int argc, char *argv[])
signal(SIGINT, signal_handler);
#else
SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE);
if (opt_priority > 0) {
DWORD prio = NORMAL_PRIORITY_CLASS;
SetPriorityClass(NULL, prio);
switch (opt_priority) {
case 1:
prio = BELOW_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;
}
SetPriorityClass(GetCurrentProcess(), prio);
}
#endif
if (active_gpus == 0) {