> This update fixes the following problem. The function
> JavaThread::java_suspend has the following assert:
>
> bool JavaThread::java_suspend(bool register_vthread_SR) {
> // Suspending a vthread transition disabler can cause deadlocks.
> assert(!is_vthread_transition_disabler(), "no suspend allowed for vthread
> transition disablers");
> . . .
>
> This is an over-hard requirement/invariant for threads that execute JVMTI
> functions (e.g. in an agent event handler). Such threads need a chance to be
> eventually suspended after JVMTI function completes its work and its
> `mountUnmountDisabler` is destructed.
>
> A more adequate approach is to tweak the function
> `HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool
> check_async_exception)`
> so it could skip a `HandshakeOperation` if
> `_handshakee->is_vthread_transition_disabler() == true`, so the same
> temporary suspension disabling mechanism would be used as for
> `_handshakee->is_disable_suspend() == true`.
>
> Testing:
> - In progress: mach5 tiers 1-6
Serguei Spitsyn has updated the pull request incrementally with one additional
commit since the last revision:
review: restored the assert and fixed the issue caused it to fire
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28740/files
- new: https://git.openjdk.org/jdk/pull/28740/files/8c25f690..b51267f3
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28740&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28740&range=00-01
Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/28740.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28740/head:pull/28740
PR: https://git.openjdk.org/jdk/pull/28740