RFR: 8288497: add support for JavaThread::is_gc_barrier_detached()

Daniel D. Daugherty dcubed at openjdk.org
Thu Jun 16 16:17:03 UTC 2022


On Wed, 15 Jun 2022 23:59:50 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/thread.inline.hpp line 264:
>> 
>>> 262: inline bool JavaThread::is_exiting() const {
>>> 263:   // Use load-acquire so that setting of _terminated by
>>> 264:   // JavaThread::set_terminated() is seen more quickly.
>> 
>> This comment should have been updated when the code in
>> JavaThread::exit() was refactored into JavaThread::set_terminated().
>> I'm doing it as part of this fix for clarity.
>
> It is a bogus comment - acquire semantics has nothing to do with seeing things more quickly.

I'm pretty sure that I wrote the original comment and you were one of my
reviewers way, way back then.

When we were trying to match up the load-acquires in the accessors with
the in-line release-store code in JavaThread::exit(), the comment was needed
(ignoring the part about "seeing things more quickly"). Now that we have
load-acquires in the accessors and a release-store in the setter, i.e., no more
in-line code in JavaThread::exit(), I no longer think we need a comment to
coordinate.

I'm in favor of dropping all instances of this comment.

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

PR: https://git.openjdk.org/jdk19/pull/20


More information about the hotspot-runtime-dev mailing list