public class Semaphore extends Object
Constructor and Description |
---|
Semaphore()
Construct a Semaphore.
|
Semaphore(int n)
Construct a Semaphore with the given counter value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
down()
Perform a down() operation, as described above.
|
boolean |
down(long timeout)
Perform a down() operation, as described above.
|
void |
up()
Perform an up() operation, as described above.
|
public Semaphore()
public Semaphore(int n)
n
- - the initial value of the internal counterpublic boolean down() throws InterruptedException
InterruptedException
public boolean down(long timeout) throws InterruptedException
InterruptedException
public void up()
Copyright © 2023. All rights reserved.