diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index f77928898e..dbf06043a1 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -960,7 +960,12 @@ void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name) bool Thread::setThreadPriority (void* handle, int priority) { constexpr auto maxInputPriority = 10; - constexpr auto lowestRealtimePriority = 8; + + #if JUCE_LINUX || JUCE_BSD + constexpr auto lowestRrPriority = 8; + #else + constexpr auto lowestRrPriority = 0; + #endif struct sched_param param; int policy; @@ -971,7 +976,7 @@ bool Thread::setThreadPriority (void* handle, int priority) if (pthread_getschedparam ((pthread_t) handle, &policy, ¶m) != 0) return false; - policy = priority < lowestRealtimePriority ? SCHED_OTHER : SCHED_RR; + policy = priority < lowestRrPriority ? SCHED_OTHER : SCHED_RR; const auto minPriority = sched_get_priority_min (policy); const auto maxPriority = sched_get_priority_max (policy); @@ -981,7 +986,7 @@ bool Thread::setThreadPriority (void* handle, int priority) if (policy == SCHED_OTHER) return 0; - return jmap (priority, lowestRealtimePriority, maxInputPriority, minPriority, maxPriority); + return jmap (priority, lowestRrPriority, maxInputPriority, minPriority, maxPriority); }(); return pthread_setschedparam ((pthread_t) handle, policy, ¶m) == 0; diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index d4129a0abc..c20358f6ab 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -118,7 +118,6 @@ public: if (nativeContext != nullptr) { renderThread = std::make_unique (1); - renderThread->setThreadPriorities (9); resume(); } }