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 and vietj committed Jan 24, 2024
1 parent 8fcd7b4 commit 52b7e89
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 52b7e89

Please sign in to comment.