8229778: TestJstatdDefaults.java failed due to "fatal error: LEAF method calling lock?"
Reviewed-by: dholmes, dcubed
--- a/src/hotspot/share/runtime/thread.cpp Mon Sep 23 19:55:26 2019 -0700
+++ b/src/hotspot/share/runtime/thread.cpp Tue Sep 24 08:54:39 2019 +0200
@@ -1803,7 +1803,10 @@
void JavaThread::block_if_vm_exited() {
if (_terminated == _vm_exited) {
// _vm_exited is set at safepoint, and Threads_lock is never released
- // we will block here forever
+ // we will block here forever.
+ // Here we can be doing a jump from a safe state to an unsafe state without
+ // proper transition, but it happens after the final safepoint has begun.
+ set_thread_state(_thread_in_vm);
Threads_lock->lock();
ShouldNotReachHere();
}