Hi,

Ok, always become the current thread before synchronizing on the ULR
sorts the ordering.
Will this introduce any other problems?

Regards,
Adrian

>From: "Bordet, Simone" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>Subject: RE: [JBoss-Dev] DeployServiceUnitTestCase.testDependsElement 
>failure
>Date: Wed, 29 May 2002 14:59:15 +0200
>
>Hi,
>
> > The hang is not predictable, but it is mostly on the
> > RaTopicUnitTestCase.
> > Trying to dump the threads crashes the VM, but below is the start
> > of one of the dumps. It appears to be a deadlock in the
> > UnifiedLoaderRepository.
> >
> > Looking at the code, there might be an ordering problem between
> > synchronized(this) and becoming the "currentThread".
> >
> > e.g.
> > A starts with removeClassLoader and synchronizes on the ULR
> > B starts with loadClassInternal and synchronizes on the ClassLoader
> > B becomes the currentThread
> > B reaches the synchronized(this) in loadClass and waits on the ULR
> > A sends a notification which leads to a loadClassInternal
> > A isn't the currentThread and waits in synchronize(ClassLoader)
> >
> > Result
> > A is waiting to become the currentThread (held by B)
> > B is waiting on the ULR (held by A) with its classloader locked
>
>If that's the case, then I think there is no other choice than using the 
>reentrant lock for every method of ULR, so that the code is wrapped into a 
>try/finally (acquire/release).
>Adrian, can you try the above to see if it works ?
>
>Thanks
>
>Simon
>
>_______________________________________________________________
>
>Don't miss the 2002 Sprint PCS Application Developer's Conference
>August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
>_______________________________________________
>Jboss-development mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jboss-development




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to