posted 14 years ago
Hi,
I can't understand the output of the following code:
Output (on my machine):
t1: in run
t1: about to sleep
t2: in run
t2: about to sleep
t1: dying
t2: dying
I thought (and still think) the output would be:
t1: in run
t1: about to sleep
t2: in run
t1: dying
t2: about to sleep
t2: dying
How is "t2: about to sleep" printed before "t1: dying"? Isn't "t1" supposed to die before "t2" can get a lock on "synchronized void meth()"?
regards, venu