|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjade.util.RWLock
public class RWLock
This class provides support for synchronizing threads acting on a generic resource in such a way that - If a thread is writing the resource no other thread can act on it in any way - Several threads can read the resource at the same time - If one or more threads are reading the resource no thread can write it
| Constructor Summary | |
|---|---|
RWLock()
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). |
void |
readLock()
Acquire the protected resource with reading privileges. |
void |
readUnlock()
Release the protected resource, previously acquired with reading privileges. |
void |
writeLock()
Acquire the protected resource with writing privileges. |
void |
writeUnlock()
Release the protected resource, previously acquired with writing privileges. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RWLock()
| Method Detail |
|---|
public void writeLock()
public void writeUnlock()
public void readLock()
public void readUnlock()
protected void onWriteStart()
protected void onWriteEnd()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||