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:
parent
c3b6162899
commit
65cefa4a7d
18
ccminer.cpp
18
ccminer.cpp
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user