Locking
Threads often exhibit a general structure:
while(true) {
doSomething();
accessSomeSharedResource();
doSomethingElse();
}
A thread executing a synchronized method may determine that it cannot proceed and call wait() .
Previous slide
Next slide
Back to first slide
View graphic version