Package org.apache.ignite.internal.util
Class GridSpinReadWriteLock
- java.lang.Object
-
- org.apache.ignite.internal.util.GridSpinReadWriteLock
-
@GridToStringExclude public class GridSpinReadWriteLock extends Object
-
-
Constructor Summary
Constructors Constructor Description GridSpinReadWriteLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreadLock()Acquires read lock.voidreadUnlock()Read unlock.StringtoString()booleantryReadLock()Tries to acquire read lock.booleantryWriteLock()Tries to acquire write lock.booleantryWriteLock(long timeout, TimeUnit unit)voidwriteLock()Acquires write lock.voidwriteLock0()Acquires write lock without sleeping between unsuccessful attempts.booleanwriteLockedByCurrentThread()voidwriteUnlock()Releases write lock.
-
-
-
Method Detail
-
readLock
public void readLock()
Acquires read lock.
-
tryReadLock
public boolean tryReadLock()
Tries to acquire read lock.- Returns:
trueif acquired.
-
readUnlock
public void readUnlock()
Read unlock.
-
writeLock
public void writeLock()
Acquires write lock.
-
writeLock0
public void writeLock0()
Acquires write lock without sleeping between unsuccessful attempts.
-
writeLockedByCurrentThread
public boolean writeLockedByCurrentThread()
- Returns:
Trueif blocked by current thread.
-
tryWriteLock
public boolean tryWriteLock()
Tries to acquire write lock.- Returns:
Trueif write lock has been acquired.
-
tryWriteLock
public boolean tryWriteLock(long timeout, TimeUnit unit) throws InterruptedException- Parameters:
timeout- Timeout.unit- Unit.- Returns:
Trueif write lock has been acquired.- Throws:
InterruptedException- If interrupted.
-
writeUnlock
public void writeUnlock()
Releases write lock.
-
-