diff --git a/src/Platform_mac.cpp b/src/Platform_mac.cpp index 456e6f744..f57c7ea1c 100644 --- a/src/Platform_mac.cpp +++ b/src/Platform_mac.cpp @@ -23,6 +23,7 @@ #include +#include #include @@ -61,6 +62,37 @@ void Platform::setProcessPriority(int priority) void Platform::setThreadPriority(int priority) { + if (priority == -1) { + return; + } + int prio = 19; + switch (priority) + { + case 1: + prio = 5; + break; + + case 2: + prio = 0; + break; + + case 3: + prio = -5; + break; + + case 4: + prio = -10; + break; + + case 5: + prio = -15; + break; + + default: + break; + } + + setpriority(PRIO_PROCESS, 0, prio); }