On Thu, 22 Feb 2024 23:43:41 GMT, Brent Christian <bchri...@openjdk.org> wrote:

>> Thanks for finding my misspelling, djelinski. 👍
>
> The use of "(un)successful(ly)" in relation to `Reference.enqueue()` is quite 
> deliberate (and builds on the previous wording, "successful").
> 
> The intention was to use it consistently (is that not the case somewhere?). 
> For example, it's also used in the new **Memory Consistency Properties** 
> section of the `java.lang.ref` package docs ("The enqueueing of a 
> reference...by a successful call to `Reference.enqueue()`...").
> 
> A "successful call to `enqueue()`" is meant to be shorthand for:
> "the reference has been enqueued, and the enqueuing was performed by the 
> `enqueue()` method (rather than by the garbage collector). Therefore there is 
> a _happens-before_ edge between the `enqueue()` method call and the dequeuing 
> of the Reference (whereas there would not be this _happens-before_ if the GC 
> had already enqueued the Reference at the time of the `enqueue()` call)."
> 
> The text emphasis with italics is to indicate this added significance of the 
> result of the `enqueue()` call -- ala `happens-before`.
> 
> I'm not aware of a similar scenario covered in the JLS, so AFAIK there is not 
> precedent to be consistent with in that regard.

Sounds good, thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16644#discussion_r1501127639

Reply via email to