A question for the real profis.
When a
thread enters a synchronized method (or block) and locks the object, what happens when a non-synchronized method is called within this synchronized block? Does the thread give ups its lock? Or does it wait until leaving the synchronized method (or block)?
In other words, are non-synchronized methods only non-synchronized when called directly, but are "synchronization-supporting" (in the sense that they keep the established lock) as long as they are called from a synchronized context?
This may be a tough question. Be honest, if you are not sure about the answer.
Thanks.
My guess is that the lock is released only when the entire synchronized block is finished, regardless of what types of methods are called inside the block.
Is my question clear?
[ July 13, 2006: Message edited by: Douglas Chorpita ]