Right now it's spread out all over the runtime and we have many special transition for not getting this wrong.
Delivery conditions are duplicate and very hard to understand.
The _suspend_flag is asynchronous and target executed:
Set bit X and thread execute method Y when doing a transition where the delivery terms are met.
Since we already have a safepoint(/handshake) poll at every possible delivery location, these can be implementerad as handshake (if we had the correct functionality).
The handshake operation could contain both the delivery terms and the delivery, thus having everything at one place and only once.
There are now 4 (soon 5) users:
- Suspend/resume
- Delivering Asynchronous exception (ThreadDeath)
- Lazy JNI critical unlocking
- JFR Native trace blocking
- Local variable reconstitution
- is blocked by
-
JDK-8245772 Handshake instead of using suspend flag for native sampling
-
- Open
-
- relates to
-
JDK-8238862 Handshakes selective poll
-
- Open
-
-
JDK-8233343 Deprecate -XX:+CriticalJNINatives flag which implements JavaCritical native functions
-
- Resolved
-
-
JDK-8223312 Utilize handshakes instead of is_thread_fully_suspended
-
- Resolved
-
-
JDK-8238761 Asynchronous handshakes
-
- Resolved
-
-
JDK-8260376 Cleanup Thread state transitions
-
- Open
-
-
JDK-8257831 Suspend with handshakes
-
- Resolved
-
-
JDK-8265934 Cleanup _suspend_flags and _special_runtime_exit_condition
-
- Resolved
-
-
JDK-8283044 Use asynchronous handshakes to deliver asynchronous exceptions
-
- Resolved
-