Class SegmentLock


  • public class SegmentLock
    extends java.lang.Object
    Segment lock for saving memory space. Notice that this class is a static class and all it's methods are static
    • Constructor Summary

      Constructors 
      Constructor Description
      SegmentLock()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void readLock​(int hash)
      read lock of lock at slot[hash % NUM_OF_LOCKS]
      static void readUnlock​(int hash)
      read unlock of lock at slot[hash % NUM_OF_LOCKS]
      static void writeLock​(int hash)
      write lock of lock at slot[hash % NUM_OF_LOCKS]
      static void writeUnlock​(int hash)
      write unlock of lock at slot[hash % NUM_OF_LOCKS]
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SegmentLock

        public SegmentLock()
    • Method Detail

      • readLock

        public static void readLock​(int hash)
        read lock of lock at slot[hash % NUM_OF_LOCKS]
        Parameters:
        hash - hash value of object to be locked
      • readUnlock

        public static void readUnlock​(int hash)
        read unlock of lock at slot[hash % NUM_OF_LOCKS]
        Parameters:
        hash - hash value of object to be locked
      • writeLock

        public static void writeLock​(int hash)
        write lock of lock at slot[hash % NUM_OF_LOCKS]
        Parameters:
        hash - hash value of object to be locked
      • writeUnlock

        public static void writeUnlock​(int hash)
        write unlock of lock at slot[hash % NUM_OF_LOCKS]
        Parameters:
        hash - hash value of object to be locked