Top Description Fields Constructors Methods
org.wildfly.common.function

public Class ThreadLocalStack<E>

extends Object
Class Inheritance
Imports
java.util.ArrayDeque, .Deque

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.

Field Summary

Modifier and TypeField and Description
private final ThreadLocal<Deque<Object>>
private static final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public E
peek()

public E
pop()

public void
push(E item)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dequeback to summary
private final ThreadLocal<Deque<Object>> deque
NULL_VALUEback to summary
private static final Object NULL_VALUE

Constructor Detail

ThreadLocalStackback to summary
public ThreadLocalStack()

Method Detail

isEmptyback to summary
public boolean isEmpty()
peekback to summary
public E peek()
popback to summary
public E pop()
pushback to summary
public void push(E item)