diff options
author | Ian Rogers <irogers@google.com> | 2014-11-11 23:08:07 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-11-12 15:29:12 -0800 |
commit | 4ad5cd3e7d519484559ef778d96fb3f0be8919fa (patch) | |
tree | 9870938a0552b4fe472d9994a55a3bf761fc69d5 /runtime/native/java_lang_Thread.cc | |
parent | 741e287b60136db49ecf8da72f2b5ca48b0a39bd (diff) | |
download | art-4ad5cd3e7d519484559ef778d96fb3f0be8919fa.tar.gz art-4ad5cd3e7d519484559ef778d96fb3f0be8919fa.tar.bz2 art-4ad5cd3e7d519484559ef778d96fb3f0be8919fa.zip |
Modify the behavior of thread suspend shootouts.
The thread doing the suspension doesn't attempt to suspend the other thread
unless it knows another thread isn't trying to suspend it. Use the suspend
count, and its lock, for this purpose.
Re-enable ThreadStress test.
Bug: 15446488
Change-Id: Idd34410c7b89d8abd6973e5699a15ca699472c78
Diffstat (limited to 'runtime/native/java_lang_Thread.cc')
-rw-r--r-- | runtime/native/java_lang_Thread.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc index 0722a2485d..420e9df2f2 100644 --- a/runtime/native/java_lang_Thread.cc +++ b/runtime/native/java_lang_Thread.cc @@ -133,11 +133,7 @@ static void Thread_nativeSetName(JNIEnv* env, jobject peer, jstring java_name) { 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; - { - MutexLock mu(self, *Locks::thread_list_suspend_thread_lock_); - thread = thread_list->SuspendThreadByPeer(peer, true, false, &timed_out); - } + Thread* thread = thread_list->SuspendThreadByPeer(peer, true, false, &timed_out); if (thread != NULL) { { ScopedObjectAccess soa(env); |