8310530: PipedOutputStream.flush() accesses sink racily

Reviewed-by: dfuchs, bpb, liach, rriggs
This commit is contained in:
Sergey Tsypanov 2023-07-24 16:24:40 +00:00 committed by Brian Burkhalter
parent fac9f88c52
commit d8f2e9ae3b

View file

@ -163,6 +163,7 @@ public class PipedOutputStream extends OutputStream {
*/
@Override
public synchronized void flush() throws IOException {
var sink = this.sink;
if (sink != null) {
synchronized (sink) {
sink.notifyAll();