previous |
start |
next
Avoiding Deadlock
- The wait method temporarily releases the object lock
and deactivates the thread
- Restroom analogy
- Don't want the person in the restroom to go to sleep if there
is no toilet paper.
- Think of the person giving up and leaving
- This gives another person a chance to enter and refill the
toilet paper
previous |
start |
next