summaryrefslogtreecommitdiffstats
path: root/runtime/base/mutex.h
diff options
context:
space:
mode:
authorbowen_lai <bowen_lai@htc.com>2015-03-13 14:34:40 +0800
committerMathieu Chartier <mathieuc@google.com>2015-03-13 10:20:40 -0700
commit2435a43f6c851c23922d8508fb17c6079248201c (patch)
treea0eea938dfbafc8f8e1546528295005d3a55ecee /runtime/base/mutex.h
parentc685bce4e6cfec075cb5b468d06b2fcdeeda2005 (diff)
downloadart-2435a43f6c851c23922d8508fb17c6079248201c.zip
art-2435a43f6c851c23922d8508fb17c6079248201c.tar.gz
art-2435a43f6c851c23922d8508fb17c6079248201c.tar.bz2
ART: Add entries_ lock for race condition
GCDaemon thread would visit incorrect RegType content when there is another thread initializing classes. Add a lock to protect entries_. https://code.google.com/p/android/issues/detail?id=159849 Change-Id: Iabaa1c7f5cc5106b60a6e3856152e0797e8a5d6d
Diffstat (limited to 'runtime/base/mutex.h')
-rw-r--r--runtime/base/mutex.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h
index 3b052c0..f9e1e62 100644
--- a/runtime/base/mutex.h
+++ b/runtime/base/mutex.h
@@ -86,6 +86,7 @@ enum LockLevel {
kModifyLdtLock,
kAllocatedThreadIdsLock,
kMonitorPoolLock,
+ kMethodVerifiersLock,
kClassLinkerClassesLock,
kBreakpointLock,
kMonitorLock,
@@ -587,9 +588,11 @@ class Locks {
// Guards lists of classes within the class linker.
static ReaderWriterMutex* classlinker_classes_lock_ ACQUIRED_AFTER(breakpoint_lock_);
+ static Mutex* method_verifiers_lock_ ACQUIRED_AFTER(classlinker_classes_lock_);
+
// When declaring any Mutex add DEFAULT_MUTEX_ACQUIRED_AFTER to use annotalysis to check the code
// doesn't try to hold a higher level Mutex.
- #define DEFAULT_MUTEX_ACQUIRED_AFTER ACQUIRED_AFTER(Locks::classlinker_classes_lock_)
+ #define DEFAULT_MUTEX_ACQUIRED_AFTER ACQUIRED_AFTER(Locks::method_verifiers_lock_)
static Mutex* allocated_monitor_ids_lock_ ACQUIRED_AFTER(classlinker_classes_lock_);