8232733: Remove need to grab Threads_lock while processing handshakes

Threads_lock is not acquired anymore while processing handshakes

Reviewed-by: coleenp, rehn, dcubed, dholmes
This commit is contained in:
Patricio Chilano Mateo 2019-12-13 14:28:22 +00:00
parent 94e8d6eca4
commit 57ece4c21a
7 changed files with 37 additions and 34 deletions

View file

@ -736,10 +736,7 @@ static bool safepoint_safe_with(JavaThread *thread, JavaThreadState state) {
}
bool SafepointSynchronize::handshake_safe(JavaThread *thread) {
// This function must be called with the Threads_lock held so an externally
// suspended thread cannot be resumed thus it is safe.
assert(Threads_lock->owned_by_self() && Thread::current()->is_VM_thread(),
"Must hold Threads_lock and be VMThread");
assert(Thread::current()->is_VM_thread(), "Must be VMThread");
if (thread->is_ext_suspended() || thread->is_terminated()) {
return true;
}