I’m updating an older plugin project from JUCE 5 to JUCE 6. After the update, the plugin now runs into a deadlock on the message thread here
Going up the call stack quite a bit (45 sub-function calls), I’m reaching this member function call, called on the same
Which shows me that the lock is already held on the message thread. According to the
CriticalSection documentation which says
If the lock is already held by the caller thread, the method returns immediately
the thread should not wait here. Still it does. A simple test application could not reproduce this issue.
Note that I do see the possible danger here in deleting a listener while iterating over the listeners, this will be definetively addressed. But for now, I’d really like to understand why this deadlock happens here. Anything stupid that I might overlook?