RFR: 8257831: Suspend with handshakes [v2]

Robbin Ehn rehn at openjdk.java.net
Wed Apr 7 07:37:34 UTC 2021


On Wed, 31 Mar 2021 05:38:14 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
>> 
>>  - Merge branch 'master' into SuspendInHandshake
>>  - 8257831: Suspend with handshake (review baseline)
>
> src/hotspot/share/runtime/handshake.cpp line 633:
> 
>> 631: bool HandshakeState::suspend_request_pending() {
>> 632:   assert(JavaThread::current()->thread_state() != _thread_blocked, "should not be in a blocked state");
>> 633:   assert(JavaThread::current()->thread_state() != _thread_in_native, "should not be in native");
> 
> Not clear why we care about the state of the current thread here ??

I missed one assert, this must be asked on yourself.
If you ask while in blocked/native the answer may change at any moment, since processing of handshake is ok.
To get a stable result you must be in another state.

Note @pchilano think we should remove this method, so either I add assert and comment or remove it.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3191


More information about the hotspot-runtime-dev mailing list