org.objectweb.perseus.concurrency.pessimistic
Class RWFifoLock
public final class 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.
- E. Bruneton, P. Dechamboux, S.Chassande-Barrioz
boolean | close(Object task) - Removes the given context from the reader and writer lists of this
lock.
|
byte | getMax()
|
void | readIntention(Object task) - Acquires this lock in read mode for the given context.
|
void | writeIntention(Object task) - Acquires this lock in write mode for the given context.
|
RWFifoLock
public RWFifoLock()
RWFifoLock
public RWFifoLock(Object hints,
DependencyGraph dg)
close
public boolean close(Object task)
Removes the given context from the reader and writer lists of this
lock.
- close in interface Lock
task
- a context
- true if the reader and writer list are empty, after the
context has been removed from these lists. In such a case, this
object can be removed from the 'locks' map.
getMax
public byte getMax()
- getMax in interface Lock
readIntention
public void readIntention(Object task)
throws ConcurrencyException
Acquires this lock in read mode for the given context. This method
blocks until the lock can be acquired in read mode by this context.
- readIntention in interface Lock
task
- a context.
writeIntention
public void writeIntention(Object task)
throws ConcurrencyException
Acquires this lock in write mode for the given context. This method
blocks until the lock can be acquired in write mode by this context.
- writeIntention in interface Lock
task
- a context.
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.