|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpsimjava.Bsemaphore
public class Bsemaphore
PsimJ Java package for OO simulation
Object-oriented simulation package, process interaction approach.
(C) J. M. Garrido. June 2000 Rev.2003, 2004, Oct. 2007 Binary semaphore class.
File: Bsemaphore.java
| Constructor Summary | |
|---|---|
Bsemaphore(java.lang.String name,
int initval)
Constructor for the binary semaphore object |
|
| Method Summary | |
|---|---|
boolean |
available()
This method checks if the semaphore object is available. |
void |
bsignal()
This method releases the semaphore object, and makes it available to other processes. |
void |
bwait()
This method allows the requesting process to acquire the semaphore if it has not been acquired by another process. |
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 Bsemaphore(java.lang.String name,
int initval)
name - the title for the semaphore objectinitval - the initial value of bsem attribute| Method Detail |
|---|
public java.lang.String get_name()
public void bwait()
public int length()
public void bsignal()
num - int, the number of resource items released by the calling process.public boolean available()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||