|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSema
public class Sema
Semaphore. This class implements a semaphore.
| Field Summary | |
|---|---|
private int |
del
|
private int |
init
|
private int |
s
|
| Constructor Summary | |
|---|---|
Sema()
Constructs a default semaphore. |
|
Sema(int i)
Constructs a semaphore with the given upper limit value. |
|
| Method Summary | |
|---|---|
protected void |
finalize()
Releases the ressources of the constructed semaphore. |
boolean |
isPositive()
checks if Semaphore is positive. |
void |
P()
Performs the P operation, which causes the current thread to wait until the semaphore is positive. |
void |
V()
The V operation increases the value of s. |
| 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
| Constructor Detail |
|---|
public Sema()
public Sema(int i)
i - limit.| Method Detail |
|---|
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void P()
public void V()
public boolean isPositive()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||