There are 3 cases where we call check_possible_safepoint() to verify it is okay to allow a safepoint/handshake to start:
1) When directly trying to process pending safepoint/handshakes (process_if_requested/process_if_requested_with_exit_check)
2) When transitioning to a safe state since that can also allow a safepoint/handshake to start
3) Places where we could have attempted to process a pending safepoint/handshake depending on a conditional, e.g. taking a branch that acquires a _safepoint_check_always lock (added byJDK-5103339).
For case 1) we should call check_possible_safepoint() in SafepointMechanism::process_if_requested(). Currently we either make that call outside(ThreadStateTransition::transition_and_process) or we don't make it at all.
1) When directly trying to process pending safepoint/handshakes (process_if_requested/process_if_requested_with_exit_check)
2) When transitioning to a safe state since that can also allow a safepoint/handshake to start
3) Places where we could have attempted to process a pending safepoint/handshake depending on a conditional, e.g. taking a branch that acquires a _safepoint_check_always lock (added by
For case 1) we should call check_possible_safepoint() in SafepointMechanism::process_if_requested(). Currently we either make that call outside(ThreadStateTransition::transition_and_process) or we don't make it at all.