This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wait method calls

 
vijay ks
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Why we are calling wait and notify methods from a
> synchronized block, what will happen if it is called
> from a non -synch method.
> pls reply .
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is illegal to call wait() or notify() unless holding the monitor of the object on which you are calling them. You'll get a runtime exception.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic