I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 15b1cbd7 authored by jrandom's avatar jrandom Committed by zzz
Browse files

synchronize the available() call, and made explicit some other synchronization

parent e9b7ca36
No related branches found
No related tags found
No related merge requests found
...@@ -352,7 +352,9 @@ class I2PSocketImpl implements I2PSocket { ...@@ -352,7 +352,9 @@ class I2PSocketImpl implements I2PSocket {
} }
public int available() { public int available() {
return bc.getCurrentSize(); synchronized (bc) {
return bc.getCurrentSize();
}
} }
public void queueData(byte[] data) { public void queueData(byte[] data) {
...@@ -366,13 +368,13 @@ class I2PSocketImpl implements I2PSocket { ...@@ -366,13 +368,13 @@ class I2PSocketImpl implements I2PSocket {
bc.append(data, off, len); bc.append(data, off, len);
} }
synchronized (I2PInputStream.this) { synchronized (I2PInputStream.this) {
notifyAll(); I2PInputStream.this.notifyAll();
} }
} }
public synchronized void notifyClosed() { public void notifyClosed() {
synchronized (I2PInputStream.this) { synchronized (I2PInputStream.this) {
notifyAll(); I2PInputStream.this.notifyAll();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment