Browse Source

Force-fix Linux thread priorities

See https://github.com/DISTRHO/juce/issues/7

Signed-off-by: falkTX <falktx@gmail.com>
tags/2020-07-14
falkTX 5 years ago
parent
commit
500ac85e3d
Signed by: falkTX <falktx@gmail.com> GPG Key ID: 2D3445A829213837
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libs/juce/source/modules/juce_core/native/juce_posix_SharedCode.h

+ 4
- 0
libs/juce/source/modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -1043,7 +1043,11 @@ bool Thread::setThreadPriority (void* handle, int priority)
if (pthread_getschedparam ((pthread_t) handle, &policy, &param) != 0)
return false;
#if JUCE_LINUX
policy = priority < 9 ? SCHED_OTHER : SCHED_RR;
#else
policy = priority == 0 ? SCHED_OTHER : SCHED_RR;
#endif
const int minPriority = sched_get_priority_min (policy);
const int maxPriority = sched_get_priority_max (policy);


Loading…
Cancel
Save