|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpsimjava.Csemaphore
public class Csemaphore
PsimJ Java package for OO simulation
Object-oriented simulation package, process interaction approach.
(C) J. M. Garrido. June 2000 Rev.2003, 2004, Oct. 2007 Counting semaphore class.
File: Csemaphore.java
| Constructor Summary | |
|---|---|
Csemaphore(java.lang.String name,
int initval)
Constructor for the counting semaphore object |
|
| Method Summary | |
|---|---|
void |
csignal()
This method increments the semaphore object Then the method reactivates and removes from the semaphore queue any waiting processes. |
void |
cwait()
This method allows the requesting process to decrement the semaphore if possible. |
java.lang.String |
get_name()
This method returns the name of the semaphore object |
int |
length()
This method gets the number of waiting processes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Csemaphore(java.lang.String name,
int initval)
name - the title for the semaphore objectinitval - the initial value of csem attribute| Method Detail |
|---|
public java.lang.String get_name()
public void cwait()
public int length()
public void csignal()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||