类 SimpleReadWriteLock
- java.lang.Object
-
- com.alibaba.nacos.config.server.utils.SimpleReadWriteLock
-
public class SimpleReadWriteLock extends java.lang.ObjectSimplest read-write lock implementation. Requires locking and unlocking must be called in pairs.- 作者:
- Nacos
-
-
字段概要
字段 修饰符和类型 字段 说明 private intstatusZero means no lock; Negative Numbers mean write locks; Positive Numbers mean read locks, and the numeric value represents the number of read locks.
-
构造器概要
构造器 构造器 说明 SimpleReadWriteLock()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 private booleanisFree()private booleanisWriteLocked()voidreleaseReadLock()Release the read lock.voidreleaseWriteLock()booleantryReadLock()Try read lock.booleantryWriteLock()Try write lock.
-
-
-
方法详细资料
-
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()
-
-