Class ThreadLocalStack<E>

java.lang.Object
org.wildfly.common.function.ThreadLocalStack<E>

public class ThreadLocalStack<E> extends Object
A thread local stack data structure. In order to avoid memory churn the underlying ArrayDeque is never freed. If we remove the deque when it is empty then this results in excessive deque allocations.
  • Constructor Details

    • ThreadLocalStack

      public ThreadLocalStack()
  • Method Details

    • push

      public void push(E item)
    • peek

      public E peek()
    • pop

      public E pop()
    • isEmpty

      public boolean isEmpty()