Fix syntax. See #342
This commit is contained in:
parent
2f71c001b4
commit
e2a7462d70
@ -73,21 +73,17 @@ public class DefaultSslBufferPool implements SslBufferPool {
|
|||||||
return index * MAX_PACKET_SIZE;
|
return index * MAX_PACKET_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteBuffer acquireBuffer() {
|
public synchronized ByteBuffer acquireBuffer() {
|
||||||
synchronized {
|
if (index == 0) {
|
||||||
if (index == 0) {
|
return ByteBuffer.allocate(MAX_PACKET_SIZE);
|
||||||
return ByteBuffer.allocate(MAX_PACKET_SIZE);
|
} else {
|
||||||
} else {
|
return (ByteBuffer) pool[-- index].clear();
|
||||||
return (ByteBuffer) pool[-- index].clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void releaseBuffer(ByteBuffer buffer) {
|
public synchronized void releaseBuffer(ByteBuffer buffer) {
|
||||||
synchronized {
|
if (index < maxBufferCount) {
|
||||||
if (index < maxBufferCount) {
|
pool[index ++] = buffer;
|
||||||
pool[index ++] = buffer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user