output: waiting for b to finish
total is: 4950
my question:
1:
when wait() is executed,the
thread must give up its lock and wait to reacquire it and then proceed with the code following it. But here "zzz" is not printing thus indicating that its exiting the loop. Can someone explain?
2:
If i use sleep() in the run(),then the output is zero.
But when a thread goes to sleep it do not release its lock, so how can the code succeeding the "wait()" can proceed?