RFR: 8314480: Memory ordering spec updates in java.lang.ref
Mandy Chung
mchung at openjdk.org
Sat Nov 18 02:01:31 UTC 2023
On Wed, 15 Nov 2023 23:17:29 GMT, Brent Christian <bchristi at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/ref/Reference.java line 393:
>>
>>> 391: * Clears this reference object. Invoking this method does not enqueue this
>>> 392: * object, and the garbage collector will no longer enqueue this object once
>>> 393: * the referent reaches the designated reachability level.
>>
>> I'm wondering if "designated reachability level" is the right words to use here. The Notification section in the package description speaks of when the reachability of the referent has changed to the value corresponding to the type of the reference and I wonder if it might be better to use wording consistent with that. Minimally it could link to the package description where the notion of reachability level is introduced.
>
> Perhaps it's sufficient to say simply that, _"the garbage collector will no longer enqueue this object."_
Is this sentence needed? Excluding the race scenario as described in the javadoc, it would be equivalent as if the Reference with null referent which will never get enqueued?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16644#discussion_r1398032486
More information about the core-libs-dev
mailing list