|
CS101 Package Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cs101.util.semaphore.BS
This class implements simple binary semaphores in java.
Interface is bs.request(), bs.release().
Copyright 1996 Massachusetts Institute of Technology
Constructor Summary | |
BS()
If no argument is supplied, the semaphore is created in its free state. |
|
BS(boolean initVal)
If the constructor is passed a boolean value, the semaphore will be initialized with this value (true => in use, false => free). |
Method Summary | |
void |
release()
Releases the semaphore. |
void |
request()
Requests the semaphore. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BS(boolean initVal)
initVal
- Initial value for semaphore. (true => in use)public BS()
Method Detail |
public void request()
release()
,
Object.wait()
public void release()
request()
,
Object.notifyAll()
|
CS101 Package Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |