8275950: Use only _thread_in_vm in ~ThreadBlockInVMPreprocess()
Reviewed-by: dholmes, dcubed
This commit is contained in:
parent
4ac8403f9a
commit
f55e68c929
@ -228,15 +228,13 @@ class ThreadBlockInVMPreprocess : public ThreadStateTransition {
|
|||||||
}
|
}
|
||||||
~ThreadBlockInVMPreprocess() {
|
~ThreadBlockInVMPreprocess() {
|
||||||
assert(_thread->thread_state() == _thread_blocked, "coming from wrong thread state");
|
assert(_thread->thread_state() == _thread_blocked, "coming from wrong thread state");
|
||||||
// Change to transition state and ensure it is seen by the VM thread.
|
// Change back to _thread_in_vm and ensure it is seen by the VM thread.
|
||||||
_thread->set_thread_state_fence(_thread_blocked_trans);
|
_thread->set_thread_state_fence(_thread_in_vm);
|
||||||
|
|
||||||
if (SafepointMechanism::should_process(_thread, _allow_suspend)) {
|
if (SafepointMechanism::should_process(_thread, _allow_suspend)) {
|
||||||
_pr(_thread);
|
_pr(_thread);
|
||||||
SafepointMechanism::process_if_requested(_thread, _allow_suspend);
|
SafepointMechanism::process_if_requested(_thread, _allow_suspend);
|
||||||
}
|
}
|
||||||
|
|
||||||
_thread->set_thread_state(_thread_in_vm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void emptyOp(JavaThread* current) {}
|
static void emptyOp(JavaThread* current) {}
|
||||||
|
@ -706,7 +706,6 @@ void SafepointSynchronize::block(JavaThread *thread) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JavaThreadState state = thread->thread_state();
|
JavaThreadState state = thread->thread_state();
|
||||||
assert(is_a_block_safe_state(state), "Illegal threadstate encountered: %d", state);
|
|
||||||
thread->frame_anchor()->make_walkable(thread);
|
thread->frame_anchor()->make_walkable(thread);
|
||||||
|
|
||||||
uint64_t safepoint_id = SafepointSynchronize::safepoint_counter();
|
uint64_t safepoint_id = SafepointSynchronize::safepoint_counter();
|
||||||
|
@ -128,14 +128,7 @@ class SafepointSynchronize : AllStatic {
|
|||||||
|
|
||||||
static bool is_a_block_safe_state(JavaThreadState state) {
|
static bool is_a_block_safe_state(JavaThreadState state) {
|
||||||
// Check that we have a valid thread_state before blocking for safepoints
|
// Check that we have a valid thread_state before blocking for safepoints
|
||||||
switch(state) {
|
return state == _thread_in_vm || state == _thread_in_Java;
|
||||||
case _thread_in_vm:
|
|
||||||
case _thread_in_Java: // From compiled code
|
|
||||||
case _thread_blocked_trans:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Called when a thread voluntarily blocks
|
// Called when a thread voluntarily blocks
|
||||||
static void block(JavaThread *thread);
|
static void block(JavaThread *thread);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user