public final class Semaphore
extends java.lang.Object
Constructor and Description |
---|
Semaphore()
Creates a counting semaphore with the inital value 0
|
Semaphore(int init)
Creates a counting semaphore with the inital value init
|
Modifier and Type | Method and Description |
---|---|
void |
give()
Signals the semaphore
|
void |
take()
Waits for the semaphore
|