public class Semaphore
extends java.lang.Object
Constructor and Description |
---|
Semaphore()
Semaphore constructor.
|
Semaphore(int n)
Semaphore constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
await()
The Dijkstra P operation: delays until the internal counter is
greater than 0 and then decrements it.
|
static void |
setMeanSleepAfterAwait(int ms)
If the parameter is greater than 0 more arbitrary interleavings
will be introduced.
|
void |
signal()
The Dijkstra V operation: increments the internal counter.
|
public Semaphore()
public Semaphore(int n)
public static void setMeanSleepAfterAwait(int ms)
public void await()
public void signal()