river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1448539 - /river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/util/QATestPreferredClassLoader.java
Date Thu, 21 Feb 2013 08:30:05 GMT
Author: peter_firmstone
Date: Thu Feb 21 08:30:05 2013
New Revision: 1448539

URL: http://svn.apache.org/r1448539
Log:
Reduce unnecessary locking, in an attempt to avoid ClassLoader deadlock on Freebsd.

Modified:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/util/QATestPreferredClassLoader.java

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/util/QATestPreferredClassLoader.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/util/QATestPreferredClassLoader.java?rev=1448539&r1=1448538&r2=1448539&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/util/QATestPreferredClassLoader.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/util/QATestPreferredClassLoader.java
Thu Feb 21 08:30:05 2013
@@ -185,8 +185,12 @@ public class QATestPreferredClassLoader 
     /**
      * Overrides loadClass(String name, boolean resolve) in the
      * PreferredClassLoader and set {@link #loadClassIsInvoked} flag to true
+     * 
+     * This was synchronized, but since it sets a volatile variable then
+     * calls the superclass which is synchronized anyway, we can safely remove 
+     * it.
      */
-    protected synchronized Class loadClass(String name, boolean resolve)
+    protected Class loadClass(String name, boolean resolve)
             throws ClassNotFoundException {
         loadClassIsInvoked = true;
         return super.loadClass(name, resolve);
@@ -195,8 +199,11 @@ public class QATestPreferredClassLoader 
     /**
      * Overrides findClass(String name, boolean resolve) in the
      * PreferredClassLoader and set {@link #findClassIsInvoked} flag to true
+     * 
+     * This method was synchronized, but we experienced ClassLoader 
+     * deadlock on freebsd OpenJDK6, so have removed it to reduce locking. 
      */
-    protected synchronized Class findClass(String name)
+    protected Class findClass(String name)
             throws ClassNotFoundException {
         findClassIsInvoked = true;
         return super.findClass(name);



Mime
View raw message