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
InterruptedExceptionpublic boolean down(long timeout)
             throws InterruptedException
InterruptedExceptionpublic void up()
Copyright © 2025. All rights reserved.