ObjectPool关闭public构造函数
This commit is contained in:
@@ -149,7 +149,7 @@ public class ABMainService implements Service {
|
||||
}
|
||||
|
||||
public static ObjectPool<ByteBuffer> newBufferPool() {
|
||||
return new ObjectPool<>(new AtomicLong(), new AtomicLong(), 16,
|
||||
return ObjectPool.createSafePool(new AtomicLong(), new AtomicLong(), 16,
|
||||
(Object... params) -> ByteBuffer.allocateDirect(8192), null, (e) -> {
|
||||
if (e == null || e.isReadOnly() || e.capacity() != 8192) return false;
|
||||
e.clear();
|
||||
|
||||
@@ -66,7 +66,7 @@ public class SncpTest {
|
||||
}
|
||||
|
||||
public static ObjectPool<ByteBuffer> newBufferPool() {
|
||||
return new ObjectPool<>(new AtomicLong(), new AtomicLong(), 16,
|
||||
return ObjectPool.createSafePool(new AtomicLong(), new AtomicLong(), 16,
|
||||
(Object... params) -> ByteBuffer.allocateDirect(8192), null, (e) -> {
|
||||
if (e == null || e.isReadOnly() || e.capacity() != 8192) return false;
|
||||
e.clear();
|
||||
|
||||
Reference in New Issue
Block a user