|
Lua SPOT v1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnl.uva.np.luaspot.Semaphore
public class Semaphore
A simple semaphore object that can be used to guard a critical section from execution of multiple threads at the same time. Calling the get() method will activate the semaphore so all other threads that try to call the get() function will wait() until the thread that acquire the get() release the lock by calling release().
Keep in mind that a get() invocation should be paired with a release() call.
| Constructor Summary | |
|---|---|
Semaphore()
|
|
| Method Summary | |
|---|---|
void |
get()
Acquire the lock. |
void |
release()
Release the acquired lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Semaphore()
| Method Detail |
|---|
public void get()
public void release()
|
Lua SPOT v1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||