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

This commit is contained in:
jrandom
2004-07-01 15:11:34 +00:00
committed by zzz
parent e9b7ca3697
commit 15b1cbd762

View File

@ -352,8 +352,10 @@ class I2PSocketImpl implements I2PSocket {
}
public int available() {
synchronized (bc) {
return bc.getCurrentSize();
}
}
public void queueData(byte[] data) {
queueData(data, 0, data.length);
@ -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();
}
}