Fix syntax. See #342

This commit is contained in:
Norman Maurer 2012-05-19 13:19:24 +02:00 committed by Trustin Lee
parent 2f71c001b4
commit e2a7462d70

View File

@ -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;
}
} }
} }
} }