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
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 3862ae2..f843ae5 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -40,6 +40,7 @@
#include "debugger.h"
#include "dex_file-inl.h"
#include "entrypoints/entrypoint_utils.h"
+#include "entrypoints/quick/quick_alloc_entrypoints.h"
#include "gc_map.h"
#include "gc/accounting/card_table-inl.h"
#include "gc/heap.h"
@@ -109,8 +110,6 @@
&quick_entrypoints_);
}
-void ResetQuickAllocEntryPoints(QuickEntryPoints* qpoints);
-
void Thread::ResetQuickAllocEntryPointsForThread() {
ResetQuickAllocEntryPoints(&quick_entrypoints_);
}