From 15b1cbd762025d9d1790a60296ea8f4a04a44a7e Mon Sep 17 00:00:00 2001 From: jrandom <jrandom> Date: Thu, 1 Jul 2004 15:11:34 +0000 Subject: [PATCH] synchronize the available() call, and made explicit some other synchronization --- .../src/net/i2p/client/streaming/I2PSocketImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java index a249b2c297..6c04d1852b 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java @@ -352,7 +352,9 @@ class I2PSocketImpl implements I2PSocket { } public int available() { - return bc.getCurrentSize(); + synchronized (bc) { + return bc.getCurrentSize(); + } } public void queueData(byte[] data) { @@ -366,13 +368,13 @@ class I2PSocketImpl implements I2PSocket { bc.append(data, off, len); } synchronized (I2PInputStream.this) { - notifyAll(); + I2PInputStream.this.notifyAll(); } } - public synchronized void notifyClosed() { + public void notifyClosed() { synchronized (I2PInputStream.this) { - notifyAll(); + I2PInputStream.this.notifyAll(); } } -- GitLab