On 11/7/06, peter royal <[EMAIL PROTECTED]> wrote:
>> To solve this problem, I think that we should review the source code >> more carefully. >> >> I don't know exactly. >> But IMO in the "unbind" method we have the "request.wait()" here. >> What will happened if the "notify" thread is happened before the > "wait" >> thread? The "unbind" method will be never returned?
Then request.done is set to true, so we don't call wait() at all. Please search for 'request.done = true' in the source code. It is also in a synchronized block. I can't think of a scenario this code blocks forever.
>> --BEGIN-- >> synchronized( request ) >> { >> while( !request.done ) >> { >> try >> { >> request.wait(); >> } >> catch( InterruptedException e ) >> { >> ExceptionMonitor.getInstance().exceptionCaught( e > ); >> } >> } >> } >> --END-- This should be fixed in the 1.2 branch, as it now uses a CountDownLatch to indicate completion.
We can use CountDownLatch, but the initial count will always be 1. What is the advantage in using it? Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6
