aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Synchronization" Watch "Synchronization" New topic
Author

Synchronization

Sundeep Gupta
Greenhorn

Joined: Feb 28, 2006
Posts: 13
Hi all,


Does a thread releases lock on all the objects when it calls wait() on an object, or only the lock of that specific object is released.

I think other object's lock will be held with thread.

Tell me whether i'm right or wrong


Thanks,
Sundeep


SCJP 5.0
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

wait() will only release the lock on the object that you are waiting on.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Synchronization