On Thu, 1 Apr 2021 03:21:31 GMT, Patricio Chilano Mateo 
<pchilanom...@openjdk.org> wrote:

>> src/hotspot/share/runtime/handshake.hpp line 142:
>> 
>>> 140:  private:
>>> 141:   volatile bool _suspended;
>>> 142:   volatile bool _suspend_requested;
>> 
>> According to the PR description `_suspend_requested` is an optimization.
>> 
>>> The "suspend requested" flag is an optimization, without it a dormant thread
>>> could be suspended and resumed many times and each would add a new
>>> asynchronous handshake. Suspend requested flag means there is already an
>>> asynchronous suspend handshake in queue which can be re-used, only the 
>>> suspend
>>> flag needs to be set.
>> 
>> I think there are a few places where _suspend_requested is queried by 
>> mistake instead of _suspended. Maybe it would help to prevent this if 
>> _suspend_requested was renamed to something that better describes its 
>> purpose, e.g. _has_async_suspend_handshake or similar.
>
> I also think it would be a good idea to rename it with something along those 
> lines.

Fixed

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

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

Reply via email to