]> source.dussan.org Git - aspectj.git/commitdiff
99861 temp fix for deadlock when Sun' Unsafe.defineClass API is used (deadlock in...
authoravasseur <avasseur>
Mon, 11 Jul 2005 15:09:52 +0000 (15:09 +0000)
committeravasseur <avasseur>
Mon, 11 Jul 2005 15:09:52 +0000 (15:09 +0000)
loadtime/src/org/aspectj/weaver/loadtime/Aj.java

index 0d17dfdec5f4bcc0415c40790672ec4b58b0b0ee..1c03f14966f6ea321bd6e12a75c84b827bf091ec 100644 (file)
@@ -74,13 +74,15 @@ public class Aj implements ClassPreProcessor {
         private static Map weavingAdaptors = new WeakHashMap();
 
         static WeavingAdaptor getWeaver(ClassLoader loader) {
-            synchronized (weavingAdaptors) {
-                WeavingAdaptor weavingAdaptor = (WeavingAdaptor) weavingAdaptors.get(loader);
-                if (weavingAdaptor == null) {
-                    weavingAdaptor = new ClassLoaderWeavingAdaptor(loader);
-                    weavingAdaptors.put(loader, weavingAdaptor);
+            synchronized(loader) {//FIXME AV - temp fix for #99861
+                synchronized (weavingAdaptors) {
+                    WeavingAdaptor weavingAdaptor = (WeavingAdaptor) weavingAdaptors.get(loader);
+                    if (weavingAdaptor == null) {
+                        weavingAdaptor = new ClassLoaderWeavingAdaptor(loader);
+                        weavingAdaptors.put(loader, weavingAdaptor);
+                    }
+                    return weavingAdaptor;
                 }
-                return weavingAdaptor;
             }
         }
     }