Bug 1350966 - Enable adaptive mutex usage on FreeBSD. r=kaie
authorJan Beich <jbeich@FreeBSD.org>
Fri, 23 Jun 2017 17:24:16 +0200
changeset 4743 6b85368f877591e3c4defd9f201dedf0fdf1d928
parent 4742 9d0a36f8a7e3775ee436e9d66132f837a5bc93a0
child 4744 17303e0dde44f1346e30a13363ec859f95f11de1
push id261
push userkaie@kuix.de
push dateFri, 23 Jun 2017 15:24:16 +0000
reviewerskaie
bugs1350966
Bug 1350966 - Enable adaptive mutex usage on FreeBSD. r=kaie
pr/src/pthreads/ptsynch.c
--- a/pr/src/pthreads/ptsynch.c
+++ b/pr/src/pthreads/ptsynch.c
@@ -50,22 +50,21 @@ pt_pthread_mutex_is_locked(pthread_mutex
 /**************************************************************/
 
 void _PR_InitLocks(void)
 {
     int rv;
     rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr); 
     PR_ASSERT(0 == rv);
 
-#ifdef LINUX
-#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#if (defined(LINUX) && (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) || \
+    (defined(FREEBSD) && __FreeBSD_version > 700055)
     rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP);
     PR_ASSERT(0 == rv);
 #endif
-#endif
 
     rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr);
     PR_ASSERT(0 == rv);
 }
 
 static void pt_PostNotifies(PRLock *lock, PRBool unlock)
 {
     PRIntn index, rv;