类 SimpleReadWriteLock


  • public class SimpleReadWriteLock
    extends java.lang.Object
    Simplest read-write lock implementation. Requires locking and unlocking must be called in pairs.
    作者:
    Nacos
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      private int status
      Zero means no lock; Negative Numbers mean write locks; Positive Numbers mean read locks, and the numeric value represents the number of read locks.
    • 字段详细资料

      • status

        private int status
        Zero means no lock; Negative Numbers mean write locks; Positive Numbers mean read locks, and the numeric value represents the number of read locks.
    • 构造器详细资料

      • SimpleReadWriteLock

        public SimpleReadWriteLock()
    • 方法详细资料

      • tryReadLock

        public boolean tryReadLock()
        Try read lock.
      • releaseReadLock

        public void releaseReadLock()
        Release the read lock.
      • tryWriteLock

        public boolean tryWriteLock()
        Try write lock.
      • releaseWriteLock

        public void releaseWriteLock()
      • isWriteLocked

        private boolean isWriteLocked()
      • isFree

        private boolean isFree()