On 7/04/2021 5:37 pm, Robbin Ehn wrote:
On Wed, 31 Mar 2021 05:38:14 GMT, David Holmes <dhol...@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.

My point was more, shouldn't we be querying the state of the handshakee? The current thread's state can't change "at any moment".

David

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

Reply via email to