On Nov 6, 2006, at 5:07 PM, Trustin Lee wrote:
Then request.done is set to true, so we don't call wait() at all. Pleasesearch for 'request.done = true' in the source code. It is also in asynchronized block. I can't think of a scenario this code blocks forever.
it should probably be declared as voilatile, in order to prevent threads viewing a stale value
We can use CountDownLatch, but the initial count will always be 1. What isthe advantage in using it?
yes, the initial count will be one. by using a CountDownLatch, synchronization is encapsulated in the Latch. less error prone, imo, as the CountDownLatch is from the JDK and well tested :)
-pete -- [EMAIL PROTECTED] - http://fotap.org/~osi
smime.p7s
Description: S/MIME cryptographic signature
