summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Thread.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2021-05-21 09:23:38 -0700
committer Hans Boehm <hboehm@google.com> 2021-05-25 16:34:18 +0000
commit9d27fbc8ced914f4726187920a7794b07eca3e71 (patch)
tree0fd6eb99d0766ac78513d650d629f217273ab294 /runtime/native/java_lang_Thread.cc
parente3124d26d725a2b042b4409abfb30a39bb76794d (diff)
Improve suspension timeout diagnostic and fix race
Fix a data race on state_and_flags. Since the access was volatile and there are system calls in the loop, this is extremely unlikey to have casused the bug here, but ... So, assuming this is still broken, produce more informative output once we time out. Remove unused argument from SuspendThreadByPeer(). It made the logic more complicated and made it harder to reason about correctness. Remove dead code after LOG(FATAL, ...) Bug: 181778559 Test: TreeHugger, temporarily paste log message into hotter path. Change-Id: I6f3455925b3a3f4726a870150aeb54ea60a38d67
Diffstat (limited to 'runtime/native/java_lang_Thread.cc')
-rw-r--r--runtime/native/java_lang_Thread.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc
index 37b3fe642e..c3b4fe09de 100644
--- a/runtime/native/java_lang_Thread.cc
+++ b/runtime/native/java_lang_Thread.cc
@@ -148,7 +148,6 @@ static void Thread_setNativeName(JNIEnv* env, jobject peer, jstring java_name) {
bool timed_out;
// Take suspend thread lock to avoid races with threads trying to suspend this one.
Thread* thread = thread_list->SuspendThreadByPeer(peer,
- /* request_suspension= */ true,
SuspendReason::kInternal,
&timed_out);
if (thread != nullptr) {