public interface IAccessGuard
acquire(). Gelingt dies, so kann die Ressource nur noch durch
den aktuellen Thread, in die Ressource geblockt wurde, genutzt werden.
Die Ressource muss nach Gebrauch wieder freigegeben werden (
release()), da ansonsten kein Zugriff auf diese Ressource mehr
moeglich ist| Modifier and Type | Method and Description |
|---|---|
void |
acquire() |
boolean |
isValid()
checks if the lock is still valid
|
boolean |
release()
Gibt einen via
acquire() erzielten exklusiven Zugriff auf
eine Resource wieder frei. |
void acquire()
throws InterruptedException,
TimeoutException,
IOException
boolean isValid()
boolean release()
throws IOException
acquire() erzielten exklusiven Zugriff auf
eine Resource wieder frei.
Falls niemand die aktuelle Ressource geblockt hat, so passiert nichts.
Falls der aktuelle Thread nicht den Zugriff auf die Ressource hat,
so wird eine Exception geworfen.IOExceptionReentrantLock.unlock()Copyright © 2017. All rights reserved.