|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthread.Semaphore
public class Semaphore
Semaphore. This class is safe against Thread InterruptedException.
Field Summary | |
---|---|
private int |
del
|
private int |
init
|
private static Logger |
logger
|
private int |
s
|
Constructor Summary | |
---|---|
Semaphore()
Constructs a default semaphore. |
|
Semaphore(int i)
Constructs a semaphore with the given upper limit value. |
Method Summary | |
---|---|
protected void |
finalize()
Finalizes this object. |
boolean |
isPositive()
Checks if Semaphore is positive. |
void |
P()
Performs the P operation. |
boolean |
P(int m)
Performs the time limited P operation. |
void |
V()
Performs the V operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int init
private int s
private int del
private static Logger logger
Constructor Detail |
---|
public Semaphore()
public Semaphore(int i)
i
- initial limit.Method Detail |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void P() throws java.lang.InterruptedException
InterruptedException.
java.lang.InterruptedException
public boolean P(int m) throws java.lang.InterruptedException
m
- time to wait.
InterruptedException.
java.lang.InterruptedException
public void V()
public boolean isPositive()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |