|
|
|
|
There are occasions when we'd like to have a number of threads waiting on a monitor. For example, there might be a number of threads capable of doing work as a Consumer. When there is work available, if the Producer calls notifyAll(), it causes all the threads waiting on that monitor to return from their wait(): public final void notifyAll()
In general, notifyAll() tends to be safer than relying on notify(). |
| The page was last updated February 19, 2008 |