synchronize the available() call, and made explicit some other synchronization
This commit is contained in:
@ -352,8 +352,10 @@ class I2PSocketImpl implements I2PSocket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int available() {
|
public int available() {
|
||||||
|
synchronized (bc) {
|
||||||
return bc.getCurrentSize();
|
return bc.getCurrentSize();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void queueData(byte[] data) {
|
public void queueData(byte[] data) {
|
||||||
queueData(data, 0, data.length);
|
queueData(data, 0, data.length);
|
||||||
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user