previous |
start |
next
Avoiding Deadlocks
- To unblock waiting thread, some other thread calls notifyAll
- Must be called on same
object
- Call when state changes
public synchronized Object
removeFirst()
{
...
notifyAll();
}
- All waiting threads removed from wait set, unblocked
- Ch9/queue2/Queue.java
previous |
start |
next