Class LazyCleanerImpl.RefQueueBlocker<T>
java.lang.Object
org.postgresql.util.LazyCleanerImpl.RefQueueBlocker<T>
- Type Parameters:
T- the type of the objects referenced by theReferences in the queue
- All Implemented Interfaces:
ForkJoinPool.ManagedBlocker
- Enclosing class:
LazyCleanerImpl
private static class LazyCleanerImpl.RefQueueBlocker<T>
extends Object
implements ForkJoinPool.ManagedBlocker
RefQueueBlocker retrieves references from the reference queue without blocking ForkJoinPool
CPU threads.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longprivate final ReferenceQueue<T> private final BooleanSupplierprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionRefQueueBlocker(ReferenceQueue<T> queue, String threadName, Duration blockTimeout, BooleanSupplier shouldTerminate) -
Method Summary
-
Field Details
-
queue
-
threadName
-
ref
-
blockTimeoutMillis
private final long blockTimeoutMillis -
shouldTerminate
-
-
Constructor Details
-
RefQueueBlocker
RefQueueBlocker(ReferenceQueue<T> queue, String threadName, Duration blockTimeout, BooleanSupplier shouldTerminate)
-
-
Method Details
-
isReleasable
public boolean isReleasable()- Specified by:
isReleasablein interfaceForkJoinPool.ManagedBlocker
-
block
- Specified by:
blockin interfaceForkJoinPool.ManagedBlocker- Throws:
InterruptedException
-
drainOne
-