Skip to content

Commit

Permalink
fix resource acquisition in hybrid pool with native threads
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofusco authored Jan 16, 2024
1 parent 13d60ce commit 766f232
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ public BufferRecycler acquirePooled() {
nativePool.acquirePooled();
}

@Override
public BufferRecycler acquireAndLinkPooled() {
// when using the ThreadLocal based pool it is not necessary to register the BufferRecycler on the pool
return isVirtual.test(Thread.currentThread()) ?
VirtualPoolHolder.virtualPool.acquireAndLinkPooled() :
nativePool.acquirePooled();
}

@Override
public void releasePooled(BufferRecycler bufferRecycler) {
if (bufferRecycler instanceof VThreadBufferRecycler) {
Expand Down

0 comments on commit 766f232

Please sign in to comment.