RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC
Kim Barrett
kbarrett at openjdk.org
Tue Sep 10 05:05:10 UTC 2024
On Mon, 9 Sep 2024 14:40:12 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> test/lib/jdk/test/lib/util/ForceGC.java line 102:
>>
>>> 100: }
>>> 101: }
>>> 102: Reference.reachabilityFence(ref);
>>
>> I think everything from the creation of ref to the line above needs to enclosed in a try-statement, with the finally-clause including RF(ref).
>
> Arguably the same might also apply to the other call to reachability fence: that is - we might need two try-finally to keep things by-the-book?
I don't see a requirement for any try-finally's here, since I don't care about the queue/ref/referent/enqueuing
for any exits other than running to the end of the function. Adding some might make the code less fragile
against future changes, but adds clutter that might never provide any benefit.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20898#discussion_r1751250311
More information about the core-libs-dev
mailing list