Bug 1290625 - Make libcubeb mutex recurse again, to avoid deadlock when getting microphone. r=achronop
authorJan-Ivar Bruaroey <jib@mozilla.com>
Fri, 29 Jul 2016 20:03:35 -0400
changeset 347499 c761bfb5fd83eb0d767adbf34012b7dda384dce9
parent 347498 3b04c5fb4e57e684fd7ff59231c059ba650ab2b0
child 347500 6271fac418d65ac5256583501bc84c865d17a943
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersachronop
bugs1290625
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1290625 - Make libcubeb mutex recurse again, to avoid deadlock when getting microphone. r=achronop MozReview-Commit-ID: AvYa8ylsdOf
media/libcubeb/src/cubeb_utils_unix.h
--- a/media/libcubeb/src/cubeb_utils_unix.h
+++ b/media/libcubeb/src/cubeb_utils_unix.h
@@ -15,21 +15,17 @@
 /* This wraps a critical section to track the owner in debug mode. */
 class owned_critical_section
 {
 public:
   owned_critical_section()
   {
     pthread_mutexattr_t attr;
     pthread_mutexattr_init(&attr);
-#ifdef DEBUG
-    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
-#else
-    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
-#endif
+    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 
 #ifdef DEBUG
     int r =
 #endif
     pthread_mutex_init(&mutex, &attr);
 #ifdef DEBUG
     assert(r == 0);
 #endif