This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
how do we ever make it to checkpoint d? right after checkpoint b we tell the other thread waiting on the Object (by calling obj.notify() ) that it's wait() should try to reacquire the lock on the Object so it may continue. *But* since we drag our feet with the sleep(), during that time, shouldn't the other thread's wait() see that it cannot get the lock at this time, and just go back to wait()'ing?
John M. Gabriele
Joined: Feb 18, 2001
whoops! i understand it now. calling notify() on an object upon which other threads are wait()'ing simply switches the waiting thread's "state" from, waiting regardless of whether or not the object has a lock on it to waiting to grab the object's lock as soon as it is available. i hope this post helped others. it helped me. heh.