Make out-of-line mutex contention dependent on ART_USE_FUTEXES.
Fix Mac build. Also fix Linux compilation if ART_USE_FUTEXES is disabled.
Change-Id: I51cb1d70b5548ea6121ff7567b9546bad0894e01
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 6362a98..423ea77 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -646,6 +646,7 @@
}
#endif
+#if ART_USE_FUTEXES
void ReaderWriterMutex::HandleSharedLockContention(Thread* self, int32_t cur_state) {
// Owner holds it exclusively, hang up.
ScopedContentionRecorder scr(this, GetExclusiveOwnerTid(), SafeGetTid(self));
@@ -657,6 +658,7 @@
}
--num_pending_readers_;
}
+#endif
bool ReaderWriterMutex::SharedTryLock(Thread* self) {
DCHECK(self == NULL || self == Thread::Current());
@@ -726,7 +728,7 @@
CHECK_MUTEX_CALL(pthread_condattr_init, (&cond_attrs));
#if !defined(__APPLE__)
// Apple doesn't have CLOCK_MONOTONIC or pthread_condattr_setclock.
- CHECK_MUTEX_CALL(pthread_condattr_setclock(&cond_attrs, CLOCK_MONOTONIC));
+ CHECK_MUTEX_CALL(pthread_condattr_setclock, (&cond_attrs, CLOCK_MONOTONIC));
#endif
CHECK_MUTEX_CALL(pthread_cond_init, (&cond_, &cond_attrs));
#endif