jack2
jack2 copied to clipboard
[RFC][WIP] posix: Set mutex type to PTHREAD_MUTEX_ERRORCHECK
When looking for a way to debug the deadlock in https://github.com/jackaudio/jack2/issues/395 I stumbled across this advisory:
https://wiki.sei.cmu.edu/confluence/display/c/POS04-C.+Avoid+using+PTHREAD_MUTEX_NORMAL+type+mutex+locks
In the end it didn't detect the deadlock (which is not a proof of it not existing) but I'll leave the PR here for your consideration. Might be helpful in the future..
having it always on is not the most useful, do we really need it all the time?
If you wrap it around a #ifdef BUILD_DEBUG (so that debug builds have it, otherwise everything still the same) I will merge the PR. thanks!