Constructor and Description |
---|
Guard() |
Guard(int numberOfResourcesToWaitFor) |
Modifier and Type | Method and Description |
---|---|
void |
addResource() |
boolean |
isReleased() |
void |
releaseResource()
decrements internal counter, possibly awakening the thread waiting for
release wait()ing in acquire()
|
void |
waitForAllResources()
Wait for the counter to get zero.
|
void |
waitForAllResources(long timeout)
Wait for the counter to get zero.
|
public void waitForAllResources() throws InterruptedException
InterruptedException
- passed from this.wait().public void waitForAllResources(long timeout) throws InterruptedException, TimeoutException
InterruptedException
- passed from this.wait().TimeoutException
- if the time specified has passed, but the counter did not reach zero.public void addResource()
public void releaseResource()
public boolean isReleased()
Copyright © 2023 Frank!Framework. All rights reserved.