Class IntrusiveChainedEntryPool<VALUE_TYPE>

java.lang.Object
io.deephaven.util.datastructures.hash.IntrusiveChainedEntryPool<VALUE_TYPE>

public class IntrusiveChainedEntryPool<VALUE_TYPE> extends Object
A pool for "free" entries to be use with IntrusiveChainedHash structures, implemented as a stack using the same adapter and intrusive fields. Requires external synchronization of all methods for concurrent use.
  • Constructor Details

    • IntrusiveChainedEntryPool

      public IntrusiveChainedEntryPool(@NotNull @NotNull io.deephaven.hash.IntrusiveChainedHashAdapter<VALUE_TYPE> adapter)
      Construct a new pool with the supplied adapter.
      Parameters:
      adapter - The adapter
  • Method Details

    • give

      public void give(@NotNull VALUE_TYPE entry)
      Give a currently un-linked entry to the pool.
      Parameters:
      entry - The entry
    • take

      @Nullable public VALUE_TYPE take()
      Take an entry from the pool.
      Returns:
      The entry taken, or null if the pool was empty