A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
Programmer Certification (SCJP/OCPJP)
Joined: Feb 28, 2006
Mar 09, 2006 04:25:00
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
Joined: Sep 28, 2004
Mar 09, 2006 04:50:00
wait() will only release the lock on the object that you are waiting on.
Java Threads, 3rd Edition
Jini in a Nutshell
Java Gems (contributor)
I agree. Here's the link:
// object lock doubt
how to acquire a lock on object.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015