|
||||||||||||
| 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.RWPri2RLock
A lock associated to an oid (see the "locks" map within the pessimistic concurrency manager). Provides "one writer/multiple readers" concurrency policy with priority to readers (there is a risk for starvation wrt writers).
| 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 |
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, logger, oid, reservations |
| Constructor Summary | |
|---|---|
RWPri2RLock()
|
|
RWPri2RLock(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.util.Set readers
| Constructor Detail |
public RWPri2RLock()
public RWPri2RLock(java.lang.Object hints,
DependencyGraph dg)
| Method Detail |
public void readIntention(java.lang.Object ctxt)
throws ConcurrencyException
readIntention in class Lockctxt - a context.
ConcurrencyException
public void writeIntention(java.lang.Object ctxt)
throws ConcurrencyException
writeIntention in class Lockctxt - a context.
ConcurrencyExceptionpublic boolean close(java.lang.Object ctxt)
close in class Lockctxt - 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 | |||||||||||