RFR: 8257831: Suspend with handshakes [v3]

Robbin Ehn rehn at openjdk.java.net
Wed Apr 7 14:03:12 UTC 2021


On Wed, 31 Mar 2021 06:50:17 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 three commits:
>> 
>>  - Merge branch 'master' into SuspendInHandshake
>>  - Merge branch 'master' into SuspendInHandshake
>>  - 8257831: Suspend with handshake (review baseline)
>
> src/hotspot/share/runtime/thread.inline.hpp line 207:
> 
>> 205: }
>> 206: 
>> 207: inline void JavaThread::set_terminated(TerminatedTypes t) {
> 
> I prefer set_terminated(arg) over the new set of methods.

We had two methods:
   void set_terminated(TerminatedTypes t);
   void set_terminated_value();
Terminated is part of the name of the method, the name of the flag, the name of the type and part of the names of two of the states, which is very confusing.

Also the setters now match the queries:
E.g.
`bool is_exiting()`

The queries do not indicate in any sense that they are queries on the terminated flag.
The state flag is an implementation detail from query POV.
So to be consistent e.g. "set_exiting()" also hides the fact that we keep track of this with a flag.

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

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


More information about the serviceability-dev mailing list