This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread example, dont know why is it a deadlock condition  RSS feed

 
Puneet Mittal
Ranch Hand
Posts: 45
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i dont understand what is this is referring to here in both of the above highlighted statements in bold.
[ August 27, 2008: Message edited by: PUNEET MITTAL ]
 
Ajay Saxena
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is referring to the current object of the class Shared.

So for example when s1.test1(s2) is called, this refers to s1
 
Puneet Mittal
Ranch Hand
Posts: 45
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks ajay, so you mean to say that the shared class is something like this

 
Ajay Saxena
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks ajay, so you mean to say that the shared class is something like this


Exactly!
 
Puneet Mittal
Ranch Hand
Posts: 45
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks, now i got it, but one thing i am not getting is that, this code will be a deadlock condition or it will be a infinite loop. when i executed this code it was running an infinite loop, but the book i took it from was saying it as a deadlock condition.so please tell me if it is a deadlock condition or not. and if it is a deadlock than how???
[ August 28, 2008: Message edited by: PUNEET MITTAL ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!