groovyx.gpars.extra166y
Class CustomConcurrentHashMap.Segment

java.lang.Object
  extended by java.util.concurrent.locks.ReentrantLock
      extended by groovyx.gpars.extra166y.CustomConcurrentHashMap.Segment
All Implemented Interfaces:
java.io.Serializable, java.util.concurrent.locks.Lock
Enclosing class:
CustomConcurrentHashMap<K,V>

static final class CustomConcurrentHashMap.Segment
extends java.util.concurrent.locks.ReentrantLock

Each Segment holds a count and table corresponding to a segment of the table. This class contains only those methods for directly assigning these fields, which must only be called while holding locks


Field Summary
(package private)  int count
           
(package private)  CustomConcurrentHashMap.Node[] table
           
 
Constructor Summary
CustomConcurrentHashMap.Segment()
           
 
Method Summary
(package private)  void clearCount()
           
(package private)  void decrementCount()
           
(package private)  CustomConcurrentHashMap.Node[] getTableForAdd(CustomConcurrentHashMap cchm)
           
(package private)  CustomConcurrentHashMap.Node[] getTableForTraversal()
           
(package private)  void incrementCount()
           
(package private)  CustomConcurrentHashMap.Node[] resizeTable(CustomConcurrentHashMap cchm)
          See the similar code in ConcurrentHashMap for explanation
 
Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

table

volatile CustomConcurrentHashMap.Node[] table

count

int count
Constructor Detail

CustomConcurrentHashMap.Segment

CustomConcurrentHashMap.Segment()
Method Detail

decrementCount

final void decrementCount()

clearCount

final void clearCount()

incrementCount

final void incrementCount()

getTableForTraversal

final CustomConcurrentHashMap.Node[] getTableForTraversal()

getTableForAdd

final CustomConcurrentHashMap.Node[] getTableForAdd(CustomConcurrentHashMap cchm)

resizeTable

final CustomConcurrentHashMap.Node[] resizeTable(CustomConcurrentHashMap cchm)
See the similar code in ConcurrentHashMap for explanation


Copyright © 2008–2012 Václav Pech. All Rights Reserved.