• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads

 
Puja S
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If Object.wait( ) method is called from a synchronized method,then the current thread will move to the waiting state until some other thread invokes the notify ( ) or notifyAll ( ) method on this object.

Can any body tell me that when the thread moves to the waiting state,will it release the lock ?

Thanks.
 
Dave Wood
bronco
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes!

(if it didn't, no other thread could call notify...because you have to have the lock to call those methods)

Remember, javadoc is your friend!
[ January 06, 2005: Message edited by: Dave Wood ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Puja" welcome to JavaRanch. Please read our JavaRanch Naming Policy and change your displayed name to conform with it. We require a <first name> <family name> format, preferably your real names.
Thanks
-Barry
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic