Browse Source

Fix for a deadlock in some (rare) threading situations.

tags/2021-05-28
jules 13 years ago
parent
commit
fa90b55cdd
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      modules/juce_core/threads/juce_Thread.cpp

+ 5
- 0
modules/juce_core/threads/juce_Thread.cpp View File

@@ -204,6 +204,11 @@ void Thread::stopThread (const int timeOutMilliseconds)
//==============================================================================
bool Thread::setPriority (const int newPriority)
{
// NB: deadlock possible if you try to set the thread prio from the thread itself,
// so using setCurrentThreadPriority instead in that case.
if (getCurrentThreadId() == getThreadId())
return setCurrentThreadPriority (newPriority);
const ScopedLock sl (startStopLock);
if (setThreadPriority (threadHandle, newPriority))


Loading…
Cancel
Save