JDK-8238761 introduced asynchronous handshakes. As [~dholmes] pointed out, the "async handshakes" terminology is conflated. Currently an async handshake cannot be executed by a remote thread, which limits certain use cases of async handshakes. For example, JDK-8236485 needs to issue no-op async handshakes during G1 concurrent refinement. The requesting thread can quickly execute the handshake for blocked target threads, then do something else while waiting for non-blocked threads.
This RFE allows an async handshake to be executed by a remote thread. It adds a subclass "SelfExecutedHandshakeClosure" inheriting "AsyncHandshakeClosure", in order to distinguish the two concepts:
- AsyncHandshakeClosure is for handshakes that is submitted asynchronously.
- SelfExecutedHandshakeClosure is for handshakes that must be executed by the target thread. These handshakes are always submitted asynchronously.