public class Semaphore
extends java.lang.Object
Constructor and Description |
---|
Semaphore()
Creates Semaphore in an up state
|
Semaphore(int downs)
Creates a semaphore and immediately puts it down the specified number of times
|
Modifier and Type | Method and Description |
---|---|
void |
down() |
boolean |
isUp() |
boolean |
tryUp() |
void |
up() |
void |
waitFor() |
boolean |
waitFor(long msTimeout) |
void |
waitForUnsafe() |
boolean |
waitForUnsafe(long msTimeout) |
public Semaphore()
public Semaphore(int downs)
public void up()
public boolean tryUp()
public void down()
public void waitFor()
public void waitForUnsafe() throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean waitFor(long msTimeout)
public boolean waitForUnsafe(long msTimeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean isUp()