On Wed, 21 Jun 2023 14:58:35 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> On second thought, this is probably not necessary; write to the sink field 
>> is in another synchronized method, and this method is synchronized already. 
>> Is the goal here to remove the synchronized on flush?
>
> Good observation. Removing `synchronized` on flush might be a worthwhile goal 
> but possible side effects (including on potential subclasses) should be 
> carefully considered.
> I support stashing `sink` in a local variable though, even if the pointer 
> can't be concurrently modified, just to make it clear that we only have one 
> volatile read.

I think it's better to keep `synchronized` over the method this far

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14589#discussion_r1238524265

Reply via email to