RFR: 8349206: j.u.l.Handler classes create deadlock risk via synchronized publish() method [v9]
David Beaumont
duke at openjdk.org
Fri Feb 28 12:54:02 UTC 2025
On Fri, 28 Feb 2025 01:09:21 GMT, Stuart Marks <smarks at openjdk.org> wrote:
>> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix @implNote to @apiNote.
>
> src/java.logging/share/classes/java/util/logging/StreamHandler.java line 288:
>
>> 286: doneHeader = true;
>> 287: }
>> 288: writer.write(formatter.getTail(this));
>
> Strictly speaking not necessary, since this is called with the lock held (as noted above!) but it's a reasonably good multi-threaded coding practice to fetch values into a local variable and reuse them, so I think this is ok as modified.
I was just being consistent with the other case (where a single read is probably needed).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23491#discussion_r1975364945
More information about the core-libs-dev
mailing list