Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Object's Lock  RSS feed

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Are the notify() and wait() methods implemented correctly? I was expecting the output to be from 0 to 10 with no double nor numbers missing, but i am actually get doubles AND number missing...
[ July 07, 2005: Message edited by: Barry Gaunt ]
 
janki tangeda
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just started reading on java threads and i have a question on the code you wrote.Don't we use wait() method to wait for some condition to be met.I don't see any such condition here.For e.g. in getValue() method, is it not required to check if the value is updated and wait until the updating is done.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!