diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-03-02 13:28:37 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-03-03 17:08:30 -0800 |
commit | d889178ec78930538d9d6a66c3df9ee9afaffbb4 (patch) | |
tree | 6fa250bdadcdfc1702f57500e618b51df6d46828 /runtime/instrumentation.h | |
parent | 06c09f6d79e037ee00113d6289ef98226680797d (diff) | |
download | art-d889178ec78930538d9d6a66c3df9ee9afaffbb4.zip art-d889178ec78930538d9d6a66c3df9ee9afaffbb4.tar.gz art-d889178ec78930538d9d6a66c3df9ee9afaffbb4.tar.bz2 |
Guard entrypoint changing by runtime shutdown lock.
There was a race when we changed the allocation entrypoints where a
new thread would be starting (Thread::Init) and initialize to the
wrong entrypoints. Guarding allocation entrypoint changing
with the runtime shutdown lock fixes this race condition since
Thread::Init is only called with the runtime shutdown lock held.
Bug: 13250963
Change-Id: I8eb209c124b6bf17020de874e1b0083f158b8200
Diffstat (limited to 'runtime/instrumentation.h')
-rw-r--r-- | runtime/instrumentation.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/instrumentation.h b/runtime/instrumentation.h index 017573a..d7a0b4d 100644 --- a/runtime/instrumentation.h +++ b/runtime/instrumentation.h @@ -167,9 +167,11 @@ class Instrumentation { return interpreter_handler_table_; } - void InstrumentQuickAllocEntryPoints() LOCKS_EXCLUDED(Locks::thread_list_lock_); - void UninstrumentQuickAllocEntryPoints() LOCKS_EXCLUDED(Locks::thread_list_lock_); - void ResetQuickAllocEntryPoints(); + void InstrumentQuickAllocEntryPoints() LOCKS_EXCLUDED(Locks::thread_list_lock_, + Locks::runtime_shutdown_lock_); + void UninstrumentQuickAllocEntryPoints() LOCKS_EXCLUDED(Locks::thread_list_lock_, + Locks::runtime_shutdown_lock_); + void ResetQuickAllocEntryPoints() EXCLUSIVE_LOCKS_REQUIRED(Locks::runtime_shutdown_lock_); // Update the code of a method respecting any installed stubs. void UpdateMethodsCode(mirror::ArtMethod* method, const void* quick_code, |