diff options
-rw-r--r-- | runtime/base/mutex.cc | 4 | ||||
-rw-r--r-- | runtime/base/mutex.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index 6362a989ae..423ea77da9 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -646,6 +646,7 @@ bool ReaderWriterMutex::ExclusiveLockWithTimeout(Thread* self, int64_t ms, int32 } #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 @@ void ReaderWriterMutex::HandleSharedLockContention(Thread* self, int32_t cur_sta } --num_pending_readers_; } +#endif bool ReaderWriterMutex::SharedTryLock(Thread* self) { DCHECK(self == NULL || self == Thread::Current()); @@ -726,7 +728,7 @@ ConditionVariable::ConditionVariable(const char* name, Mutex& guard) 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 diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h index 25fdd59f8a..628231a273 100644 --- a/runtime/base/mutex.h +++ b/runtime/base/mutex.h @@ -360,10 +360,10 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { virtual void Dump(std::ostream& os) const; private: +#if ART_USE_FUTEXES // Out-of-inline path for handling contention for a SharedLock. void HandleSharedLockContention(Thread* self, int32_t cur_state); -#if ART_USE_FUTEXES // -1 implies held exclusive, +ve shared held by state_ many owners. AtomicInteger state_; // Exclusive owner. Modification guarded by this mutex. |