static final class ConcurrentHashMapV8.TreeBin<K,V> extends ConcurrentHashMapV8.Node<K,V>
Modifier and Type | Field and Description |
---|---|
(package private) ConcurrentHashMapV8.TreeNode<K,V> |
first |
(package private) int |
lockState |
private static long |
LOCKSTATE |
(package private) static int |
READER |
(package private) ConcurrentHashMapV8.TreeNode<K,V> |
root |
private static sun.misc.Unsafe |
U |
(package private) java.lang.Thread |
waiter |
(package private) static int |
WAITER |
(package private) static int |
WRITER |
hash, key, next, val
Constructor and Description |
---|
TreeBin(ConcurrentHashMapV8.TreeNode<K,V> b)
Creates bin with initial set of nodes headed by b.
|
Modifier and Type | Method and Description |
---|---|
(package private) static <K,V> ConcurrentHashMapV8.TreeNode<K,V> |
balanceDeletion(ConcurrentHashMapV8.TreeNode<K,V> root,
ConcurrentHashMapV8.TreeNode<K,V> x) |
(package private) static <K,V> ConcurrentHashMapV8.TreeNode<K,V> |
balanceInsertion(ConcurrentHashMapV8.TreeNode<K,V> root,
ConcurrentHashMapV8.TreeNode<K,V> x) |
(package private) static <K,V> boolean |
checkInvariants(ConcurrentHashMapV8.TreeNode<K,V> t)
Recursive invariant check
|
private void |
contendedLock()
Possibly blocks awaiting root lock.
|
(package private) ConcurrentHashMapV8.Node<K,V> |
find(int h,
java.lang.Object k)
Returns matching node or null if none.
|
private void |
lockRoot()
Acquires write lock for tree restructuring.
|
(package private) ConcurrentHashMapV8.TreeNode<K,V> |
putTreeVal(int h,
K k,
V v)
Finds or adds a node.
|
(package private) boolean |
removeTreeNode(ConcurrentHashMapV8.TreeNode<K,V> p)
Removes the given node, that must be present before this
call.
|
(package private) static <K,V> ConcurrentHashMapV8.TreeNode<K,V> |
rotateLeft(ConcurrentHashMapV8.TreeNode<K,V> root,
ConcurrentHashMapV8.TreeNode<K,V> p) |
(package private) static <K,V> ConcurrentHashMapV8.TreeNode<K,V> |
rotateRight(ConcurrentHashMapV8.TreeNode<K,V> root,
ConcurrentHashMapV8.TreeNode<K,V> p) |
private void |
unlockRoot()
Releases write lock for tree restructuring.
|
equals, getKey, getValue, hashCode, setValue, toString
ConcurrentHashMapV8.TreeNode<K,V> root
volatile ConcurrentHashMapV8.TreeNode<K,V> first
volatile java.lang.Thread waiter
volatile int lockState
static final int WRITER
static final int WAITER
static final int READER
private static final sun.misc.Unsafe U
private static final long LOCKSTATE
TreeBin(ConcurrentHashMapV8.TreeNode<K,V> b)
private final void lockRoot()
private final void unlockRoot()
private final void contendedLock()
final ConcurrentHashMapV8.Node<K,V> find(int h, java.lang.Object k)
find
in class ConcurrentHashMapV8.Node<K,V>
final ConcurrentHashMapV8.TreeNode<K,V> putTreeVal(int h, K k, V v)
final boolean removeTreeNode(ConcurrentHashMapV8.TreeNode<K,V> p)
static <K,V> ConcurrentHashMapV8.TreeNode<K,V> rotateLeft(ConcurrentHashMapV8.TreeNode<K,V> root, ConcurrentHashMapV8.TreeNode<K,V> p)
static <K,V> ConcurrentHashMapV8.TreeNode<K,V> rotateRight(ConcurrentHashMapV8.TreeNode<K,V> root, ConcurrentHashMapV8.TreeNode<K,V> p)
static <K,V> ConcurrentHashMapV8.TreeNode<K,V> balanceInsertion(ConcurrentHashMapV8.TreeNode<K,V> root, ConcurrentHashMapV8.TreeNode<K,V> x)
static <K,V> ConcurrentHashMapV8.TreeNode<K,V> balanceDeletion(ConcurrentHashMapV8.TreeNode<K,V> root, ConcurrentHashMapV8.TreeNode<K,V> x)
static <K,V> boolean checkInvariants(ConcurrentHashMapV8.TreeNode<K,V> t)