Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deadlock

 
Sudhanshu Mishra
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right, the run method obtains the lock on the XMap object not the Thread object...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic