for the record, there is a lot of serious misinformation in this thread, and for posterity's sake, i'd like to correct it.
1) the bug here was a kernel bug, not anything in JUCE or specific plugins. This became clear by the end of the thread, but that should have been clear from the outset: user space code CANNOT cause kernel crashes without the presence of a kernel bug. This is just a matter of definition.
2) it is absolutely NOT true that it is necessary to enable priority inheritance on pthread mutexes in order to avoid deadlocks. code that would deadlock in this fashion without priority inheritance is almost always incorrectly written. there is a tool named "lockdep" which can be used to analyse locking patterns and will identify lock dependencies like the one described by XRyl669. when they are discovered, they should be fixed. if you are writing code and find yourself considering lock dependencies like this, go back to the drawing board, because something has gone wrong.
3) recursive mutexes are generally considered extremely poor design. if you don't believe me, start here:
http://zaval.org/resources/library/butenhof1.html TL;DR:
"Recursive mutexes can be a great tool for prototyping thread support in an existing library, exactly because it lets you defer the hard part: the call path and data dependency analysis of the library. But for that same reason, always remember that you're not DONE until they're all gone, so you can produce a library you're proud of, that won't unnecessarily contrain the concurrency of the entire application. "4) taking locks in a realtime thread is nearly always a sign of the wrong design. from a quick scan of the JUCE code in question, it is not clear why JUCE is not using a ringbuffer (a.ka. FIFO) which is lockfree for single-reader/single-writer use, rather than a mutex. this may be too superficial of a scan of the code, so i apologize if i've missed something.
btw, huge fan of JUCE. wish we had used it for Ardour from the start (which would have benefitted both Ardour and JUCE, I think)