|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjade.util.RWLock
jade.util.SynchList
public class SynchList
Implementation of a list of objects providing methods to synchronize threads acting on the list in such a way to prevent concurrent modifications (addition/remotion of elements) and concurrent scanning/modification. Concurrent scannings are allowed instead.
| Constructor Summary | |
|---|---|
SynchList()
Default constructor. |
|
| Method Summary | |
|---|---|
protected void |
onWriteEnd()
This placeholder method is called every time a thread actually releases the protected resource with writing privileges (this means that, in case of multiple recursive unlocking by the same thread, this method is called only the last time). |
protected void |
onWriteStart()
This placeholder method is called every time a thread actually acquires the protected resource with writing privileges (this means that, in case of multiple recursive locking by the same thread, this method is called only the first time). |
List |
startModifying()
This method grants writing privileges to the calling thread and grants access to the protected list. |
List |
startScanning()
This method grants reading privileges to the calling thread and grants access to the protected list. |
void |
stopModifying()
This method must be called when a writer thread has finished modifying the list, so that the associated readers-writer lock can be relinquished. |
void |
stopScanning()
This method must be called when a reader thread has finished accessing the list, so that the associated readers-writer lock can be relinquished. |
| Methods inherited from class jade.util.RWLock |
|---|
readLock, readUnlock, writeLock, writeUnlock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SynchList()
| Method Detail |
|---|
public List startModifying()
public void stopModifying()
public List startScanning()
public void stopScanning()
protected void onWriteStart()
RWLock
onWriteStart in class RWLockprotected void onWriteEnd()
RWLock
onWriteEnd in class RWLock
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||