|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object monitor.Semaphore
public class Semaphore
A FIFO semaphore.
Constructor Summary | |
---|---|
Semaphore(int initial_value)
Initialize the semaphore to a value greater or equal to 0 |
Method Summary | |
---|---|
void |
acquire()
The P operation. |
void |
acquire(int priority)
The P operation with a priority. |
void |
release()
The V operation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Semaphore(int initial_value)
Method Detail |
---|
public void acquire()
public void acquire(int priority)
priority
- The larger the integer, the less urgent the priority.
If two thread are waiting with equal priority, they will complete acquire
in FIFO order.public void release()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |