public class ReadWriteLock
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
ReadWriteLock.ActionPerformedListener
Listener performing post-action operations.
|
Modifier and Type | Field and Description |
---|---|
protected Future<java.lang.Void> |
finishedfuture
Future for notifying finished condition.
|
protected java.util.LinkedList<IResultCommand<IFuture<java.lang.Void>,java.lang.Void>> |
readbacklog
Backlog of read requests
|
protected int |
reads
Number of read operations in progress
|
protected boolean |
write
Flag of the write operation in progress
|
protected java.util.LinkedList<IResultCommand<IFuture<java.lang.Void>,java.lang.Void>> |
writebacklog
Backlog of write requests
|
Constructor and Description |
---|
ReadWriteLock() |
Modifier and Type | Method and Description |
---|---|
IFuture<java.lang.Void> |
notifyWhenFinished()
Returns a future notifying if/when the operations queue is currently empty.
|
void |
scheduleRead(IResultCommand<IFuture<java.lang.Void>,java.lang.Void> readcommand)
Schedules a read operation.
|
void |
scheduleWrite(IResultCommand<IFuture<java.lang.Void>,java.lang.Void> writecommand)
Schedules a write operation.
|
protected int reads
protected boolean write
protected java.util.LinkedList<IResultCommand<IFuture<java.lang.Void>,java.lang.Void>> readbacklog
protected java.util.LinkedList<IResultCommand<IFuture<java.lang.Void>,java.lang.Void>> writebacklog
protected Future<java.lang.Void> finishedfuture
public void scheduleRead(IResultCommand<IFuture<java.lang.Void>,java.lang.Void> readcommand)
readcommand
- The read command.public void scheduleWrite(IResultCommand<IFuture<java.lang.Void>,java.lang.Void> writecommand)
writecommand
- The write operation.public IFuture<java.lang.Void> notifyWhenFinished()