|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.locks.ReentrantReadWriteLock.WriteLock
org.gcube.common.core.state.GCUBEReadWriteLock.GCUBEWriteLock
public static class GCUBEReadWriteLock.GCUBEWriteLock
An extension of ReentrantReadWriteLock.WriteLock that supports
preemptive requests and acquisitions.
| Method Summary | |
|---|---|
void |
cancelPreemptive()
Indicates failure of the preemptive thread. |
void |
lock()
Deprecated. use lockInterruptibly() instead. |
void |
lockInterruptibly()
|
void |
lockPreemptively()
Acquires the lock preemptively. |
boolean |
tryLock()
Extends the semantics of Lock.tryLock() to cater for lock preemption. |
boolean |
tryLock(long timeout,
TimeUnit unit)
|
void |
unlock()
Extends unlock() to interrupt writer and reader threads in queue for the lock
when invoked by the preemptive thread. |
| Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock |
|---|
getHoldCount, isHeldByCurrentThread, newCondition, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void lock()
throws org.gcube.common.core.state.GCUBEReadWriteLock.LockPreemptedException
lockInterruptibly() instead.
Lock.lock() to cater for lock preemption.
lock in interface Locklock in class ReentrantReadWriteLock.WriteLockLockPreemptedException - if the lock is preempted.
org.gcube.common.core.state.GCUBEReadWriteLock.LockPreemptedExceptionpublic boolean tryLock()
Lock.tryLock() to cater for lock preemption.
tryLock in interface LocktryLock in class ReentrantReadWriteLock.WriteLockfalse if the lock is already held by another thread or has been preempted.
public void lockInterruptibly()
throws InterruptedException
lockInterruptibly in interface LocklockInterruptibly in class ReentrantReadWriteLock.WriteLockInterruptedException
public void lockPreemptively()
throws InterruptedException
LockPreemptedException - if the lock is preempted.
InterruptedException
public boolean tryLock(long timeout,
TimeUnit unit)
throws InterruptedException
tryLock in interface LocktryLock in class ReentrantReadWriteLock.WriteLockInterruptedExceptionpublic void unlock()
unlock() to interrupt writer and reader threads in queue for the lock
when invoked by the preemptive thread.
unlock in interface Lockunlock in class ReentrantReadWriteLock.WriteLock
public void cancelPreemptive()
throws IllegalMonitorStateException
IllegalMonitorStateException - if the calling thread is not the preemptive thread or
it is the preemptive thread but it has already released the lock.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||