Bug 1284198 - Don't USE_CLOCK_API on macOS. r=terrence, a=gchang
authorojab <ojab@ojab.ru>
Mon, 04 Jul 2016 01:29:00 +0200
changeset 342074 53d175f97046f0499c60ab70d16be1ad1514421c
parent 342073 b2ef50220539eaee044d838de747e1e38fd1f1d2
child 342075 2fc57c35067e840cce7c547584c95b277e5598e6
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence, gchang
bugs1284198
milestone49.0a2
Bug 1284198 - Don't USE_CLOCK_API on macOS. r=terrence, a=gchang macOS 10.12 like Android has clock functions, but not pthread_condattr_setclock
js/src/threading/posix/ConditionVariable.cpp
--- a/js/src/threading/posix/ConditionVariable.cpp
+++ b/js/src/threading/posix/ConditionVariable.cpp
@@ -18,18 +18,18 @@
 #include "threading/posix/MutexPlatformData.h"
 
 using mozilla::CheckedInt;
 using mozilla::TimeDuration;
 using mozilla::TimeStamp;
 
 static const long NanoSecPerSec = 1000000000;
 
-// Android has the clock functions, but not pthread_condattr_setclock.
-#if defined(HAVE_CLOCK_MONOTONIC) && !defined(__ANDROID__)
+// Android & macOS 10.12 has the clock functions, but not pthread_condattr_setclock.
+#if defined(HAVE_CLOCK_MONOTONIC) && !defined(__ANDROID__) && !defined(__APPLE__)
 # define USE_CLOCK_API
 #endif
 
 #ifdef USE_CLOCK_API
 // The C++ specification defines std::condition_variable::wait_for in terms of
 // std::chrono::steady_clock, which is closest to CLOCK_MONOTONIC.
 static const clockid_t WhichClock = CLOCK_MONOTONIC;