Skip to content

Commit a7b8c7f

Browse files
committed
Lower priority for Windows
Signed-off-by: Pttn <28868425+Pttn@users.noreply.github.com>
1 parent b0b2fa6 commit a7b8c7f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,10 @@ void signalHandler(int signum) {
377377
}
378378

379379
int main(int argc, char** argv) {
380-
#ifndef _WIN32
380+
#ifdef _WIN32
381+
// Set lower priority, else the whole Windows system would lag a lot if using all threads
382+
SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
383+
#else
381384
struct sigaction SIGINTHandler;
382385
SIGINTHandler.sa_handler = signalHandler;
383386
sigemptyset(&SIGINTHandler.sa_mask);

0 commit comments

Comments
 (0)