diff options
Diffstat (limited to 'runtime/native/dalvik_system_VMStack.cc')
-rw-r--r-- | runtime/native/dalvik_system_VMStack.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/native/dalvik_system_VMStack.cc b/runtime/native/dalvik_system_VMStack.cc index b0792293e0..eef1c46c1f 100644 --- a/runtime/native/dalvik_system_VMStack.cc +++ b/runtime/native/dalvik_system_VMStack.cc @@ -34,12 +34,13 @@ static jobject GetThreadStack(const ScopedFastNativeObjectAccess& soa, jobject p } else { // Suspend thread to build stack trace. soa.Self()->TransitionFromRunnableToSuspended(kNative); + ThreadList* thread_list = Runtime::Current()->GetThreadList(); bool timed_out; Thread* thread; { // Take suspend thread lock to avoid races with threads trying to suspend this one. MutexLock mu(soa.Self(), *Locks::thread_list_suspend_thread_lock_); - thread = ThreadList::SuspendThreadByPeer(peer, true, false, &timed_out); + thread = thread_list->SuspendThreadByPeer(peer, true, false, &timed_out); } if (thread != nullptr) { // Must be runnable to create returned array. @@ -47,7 +48,7 @@ static jobject GetThreadStack(const ScopedFastNativeObjectAccess& soa, jobject p trace = thread->CreateInternalStackTrace<false>(soa); soa.Self()->TransitionFromRunnableToSuspended(kNative); // Restart suspended thread. - Runtime::Current()->GetThreadList()->Resume(thread, false); + thread_list->Resume(thread, false); } else { if (timed_out) { LOG(ERROR) << "Trying to get thread's stack failed as the thread failed to suspend within a " |