Suleyman Suleymanov wrote:when i uncomment the try-catch block i get this output :
0 t1
0 t2
doesn't it mean that t1 release lock when it goes to sleep and t2 get the lock?
Oh... I am sorry. I misread your question...
No. Thread.sleep() does *not* release any locks. The reason that the two threads are interlacing is because the two threads are using two different locks.
Henry