• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Thread isn't being notified in this case

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

This program's output is "Inside run" why it isn't printing "After Wait and notify"
My question is Why Thread isn't being notified in this case

 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the following - copied from the java.lang.Object#wait() documentation

Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.


Now, in the code you posted, which thread invokes notify()?
 
Mike Peters
Ranch Hand
Posts: 67
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the thread waiting for?
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, in the code you posted, which thread invokes notify()?

nice point , thanks Klap
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!