public void unlock()
This unlocks the mutex, waking up one thread (if any are sleeping).
The Class Extensions.ConditionVar
This is one of our classes. It implements POSIX-style condition variables. Use only when
synchronized sections and wait/notify won't work.
public void condWait(Mutex m)
This causes the current thread to block until it is awakened by either a call to condSignal() or
by a spurious wakeup (not by interruption). It will release the mutex lock for the object as it goes
to sleep, and reacquire it before returning.
public void condSignal()
public void condBroadcast()
These cause (one/all) of the threads that are in a condWait() call to wake up and return.
The main issue in writing MT programs is how to get threads to work together. Locks
(synchronized sections) and condition variables (wait/notify) are the fundamental building blocks
from which anything can be built. Although there are many nonintuitive aspects of
synchronization, most of them can be ignored, as things "just work."
Search WWH :