RFR: 8257831: Suspend with handshakes [v4]

Daniel D.Daugherty dcubed at openjdk.java.net
Fri Apr 9 16:19:39 UTC 2021


On Wed, 7 Apr 2021 07:23:26 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> src/hotspot/share/runtime/handshake.cpp line 415:
>> 
>>> 413:   // Adds are done lock free and so is arming.
>>> 414:   // Calling this method with lock held is considered an error.
>>> 415:   assert(!_lock.owned_by_self(), "Lock should not be held");
>> 
>> If adds are still lock-free then why was this assertion removed?
>
> Because we add the async handshake inside the sync handshake and thus we already hold the _lock.

Doesn't that mean the comment on L415 needs updating?
Should it be something like:
// Synchronous adds are done lock free and so is arming, but some
// asynchronous adds are done when we already hold the lock.
I'm not sure about the "some asynchronous adds" part...

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

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


More information about the hotspot-runtime-dev mailing list