Class OReadersWriterSpinLock
java.lang.Object
java.util.concurrent.locks.AbstractOwnableSynchronizer
com.orientechnologies.common.concur.lock.OReadersWriterSpinLock
- All Implemented Interfaces:
Serializable
- Since:
- 8/18/14
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidbooleantryAcquireReadLock(long timeout) Tries to acquire lock during provided interval of time and returns either if provided time interval was passed or if lock was acquired.Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
-
Constructor Details
-
OReadersWriterSpinLock
public OReadersWriterSpinLock()
-
-
Method Details
-
tryAcquireReadLock
public boolean tryAcquireReadLock(long timeout) Tries to acquire lock during provided interval of time and returns either if provided time interval was passed or if lock was acquired.- Parameters:
timeout- Timeout during of which we should wait for read lock.- Returns:
trueif read lock was acquired.
-
acquireReadLock
public void acquireReadLock() -
releaseReadLock
public void releaseReadLock() -
acquireWriteLock
public void acquireWriteLock() -
releaseWriteLock
public void releaseWriteLock()
-