|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.perseus.concurrency.pessimistic.Lock
org.objectweb.perseus.concurrency.pessimistic.RWFifoLock
A lock associated to an oid (see the "locks" map within the pessimistic concurrency manager). Provides "one writer/multiple readers" concurrency policy with a FIFO scheduling.
Field Summary | |
protected java.util.Set |
readers
The contexts that have a read lock for the oid to which this object is associated. |
protected java.lang.Object |
upgrader
The context that expect to upgrade from read to write lock. |
protected java.util.ArrayList |
waiters
The contexts that wait for lock for the oid to which this object is associated. |
protected java.lang.Object |
writer
The contexts that have a lock for the oid to which this object is associated. |
Fields inherited from class org.objectweb.perseus.concurrency.pessimistic.Lock |
dg, hints, reservations |
Constructor Summary | |
RWFifoLock()
|
|
RWFifoLock(java.lang.Object hints,
DependencyGraph dg)
|
Method Summary | |
boolean |
close(java.lang.Object ctxt)
Removes the given context from the reader and writer lists of this lock. |
byte |
getMax()
|
void |
readIntention(java.lang.Object ctxt)
Acquires this lock in read mode for the given context. |
void |
writeIntention(java.lang.Object ctxt)
Acquires this lock in write mode for the given context. |
Methods inherited from class org.objectweb.perseus.concurrency.pessimistic.Lock |
reserve |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Object writer
protected java.lang.Object upgrader
protected java.util.Set readers
protected java.util.ArrayList waiters
Constructor Detail |
public RWFifoLock()
public RWFifoLock(java.lang.Object hints, DependencyGraph dg)
Method Detail |
public void readIntention(java.lang.Object ctxt) throws ConcurrencyException
readIntention
in class Lock
ctxt
- a context.
ConcurrencyException
public void writeIntention(java.lang.Object ctxt) throws ConcurrencyException
writeIntention
in class Lock
ctxt
- a context.
ConcurrencyException
public boolean close(java.lang.Object ctxt)
close
in class Lock
ctxt
- a context
public byte getMax()
getMax
in class Lock
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |