diff options
author | 2023-08-24 18:35:50 +0000 | |
---|---|---|
committer | 2023-09-09 18:03:51 +0000 | |
commit | f9fdd3ce0180972dc8d4f0c8410ea7702828a703 (patch) | |
tree | 903b17909ac50aeb4c7e5f307e5524210c699fc4 /runtime/native/java_lang_Thread.cc | |
parent | 2237607aca5e75d0b608500f8d140a0ed6c7a698 (diff) |
Revert^14 "Thread suspension cleanup and deadlock fix"
This reverts commit 2a52e8a50c3bc9011713a085f058130bb13fd6a6.
PS1 is identical to aosp/2710354.
PS2 fixes a serious bug in the ThreadExitFlag list handling code.
This didn't show up in presubmit because the list rarely contains
more than a single element. Added an explicit gtest, and a bunch
of DCHECKS around this.
PS3 Rebase and fix oat version. Once more.
PS4 Weaken CheckEmptyCheckpointFromWeakRefAccess check to allow
weak reference access in a checkpoint.
This happens via DumpLavaStack -> ... -> MonitorObjectsStackVisitor
-> ... -> FindResolvedMethod -> ... -> IsDexFileRegistered. I haven't
yet been able to convince myself that this is inherently broken,
though it is trickier than I would like.
PS5 Move cp_placeholder_mutex_ declaration higher in thread.h.
Test: m test-art-host-gtest
Change-Id: I66342ef1de27bfa0272702b5e1d3063ef8da7394
Diffstat (limited to 'runtime/native/java_lang_Thread.cc')
-rw-r--r-- | runtime/native/java_lang_Thread.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc index 570c554782..fd67a0a7fa 100644 --- a/runtime/native/java_lang_Thread.cc +++ b/runtime/native/java_lang_Thread.cc @@ -147,11 +147,8 @@ static void Thread_setNativeName(JNIEnv* env, jobject peer, jstring java_name) { // thread list lock to avoid this, as setting the thread name causes mutator to lock/unlock // in the DDMS send code. ThreadList* thread_list = Runtime::Current()->GetThreadList(); - bool timed_out; // Take suspend thread lock to avoid races with threads trying to suspend this one. - Thread* thread = thread_list->SuspendThreadByPeer(peer, - SuspendReason::kInternal, - &timed_out); + Thread* thread = thread_list->SuspendThreadByPeer(peer, SuspendReason::kInternal); if (thread != nullptr) { { ScopedObjectAccess soa(env); @@ -159,9 +156,6 @@ static void Thread_setNativeName(JNIEnv* env, jobject peer, jstring java_name) { } bool resumed = thread_list->Resume(thread, SuspendReason::kInternal); DCHECK(resumed); - } else if (timed_out) { - LOG(ERROR) << "Trying to set thread name to '" << name.c_str() << "' failed as the thread " - "failed to suspend within a generous timeout."; } } |