RFR: 8310530: PipedOutputStream.flush() accesses sink racily

Chen Liang liach at openjdk.org
Wed Jun 21 14:09:21 UTC 2023


On Wed, 21 Jun 2023 14:01:33 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:

> Just a tiny clean-up to remove racy read within synchronized method

src/java.base/share/classes/java/io/PipedOutputStream.java line 166:

> 164:     @Override
> 165:     public synchronized void flush() throws IOException {
> 166:         PipedInputStream sink = this.sink;

Suggestion:

        var sink = this.sink;

As seen in other methods.

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

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


More information about the core-libs-dev mailing list