jQuery in Action, 2nd edition*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Deadlock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Deadlock" Watch "Deadlock" New topic
Author

Deadlock

Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 215

Hi all,
I am a bit confused about following code's output.



Why a deadlock is not happening,because the main method has locked td and hence after td.start(),the run method should have a lock on td.But the point is that does the run method ever has a lock on td,or is it the XMap object?

Please clarify...
Thanks...
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

You are right, the run method obtains the lock on the XMap object not the Thread object...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deadlock
 
Similar Threads
Thread Question - Examlab Practice Exam 1
Threads
question exam lab. thread, sleep
Thread's question
question about thread output from examlab practice test 1