RFR: 8310530: PipedOutputStream.flush() accesses sink racily [v2]

Roger Riggs rriggs at openjdk.org
Thu Jun 22 21:03:06 UTC 2023


On Wed, 21 Jun 2023 15:03:12 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:

>> Just a tiny clean-up to remove racy read within synchronized method
>
> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update src/java.base/share/classes/java/io/PipedOutputStream.java
>   
>   Co-authored-by: liach <7806504+liach at users.noreply.github.com>

I think the bug description should include a bit more detail along the lines that since the method reading and writing are synchronized, its not really a racy read. It does avoid reading the volatile value twice (a relatively expensive operation).

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

PR Comment: https://git.openjdk.org/jdk/pull/14589#issuecomment-1603308404


More information about the core-libs-dev mailing list