From 719d1a33f6569864f529e5a3fff59e7bca97aad0 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Thu, 6 Mar 2014 12:13:39 -0800 Subject: Enable annotalysis on clang ART builds. Fix clang build errors aswell as restructure locking/mutex code for correct thread safety analysis support. Reorder make dependencies so that host builds build first as they should provide better compilation errors than target. Remove host's use of -fno-omit-frame-pointer as it has no value with correct use of CFI, which we should have. Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90 --- runtime/monitor.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/monitor.h') diff --git a/runtime/monitor.h b/runtime/monitor.h index d0a3a2e..eb07196 100644 --- a/runtime/monitor.h +++ b/runtime/monitor.h @@ -27,7 +27,6 @@ #include "atomic.h" #include "base/mutex.h" #include "object_callbacks.h" -#include "sirt_ref.h" #include "thread_state.h" namespace art { @@ -37,6 +36,7 @@ namespace mirror { class Object; } // namespace mirror class LockWord; +template class SirtRef; class Thread; class StackVisitor; @@ -58,11 +58,11 @@ class Monitor { NO_THREAD_SAFETY_ANALYSIS; // TODO: Reading lock owner without holding lock is racy. static mirror::Object* MonitorEnter(Thread* thread, mirror::Object* obj) - EXCLUSIVE_LOCK_FUNCTION(monitor_lock_) + EXCLUSIVE_LOCK_FUNCTION(obj) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); static bool MonitorExit(Thread* thread, mirror::Object* obj) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) - UNLOCK_FUNCTION(monitor_lock_); + UNLOCK_FUNCTION(obj); static void Notify(Thread* self, mirror::Object* obj) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { @@ -178,6 +178,7 @@ class Monitor { static uint32_t lock_profiling_threshold_; Mutex monitor_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; + ConditionVariable monitor_contenders_ GUARDED_BY(monitor_lock_); // Number of people waiting on the condition. -- cgit v1.1