harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r506901 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
Date Tue, 13 Feb 2007 08:10:53 GMT
Author: smishura
Date: Tue Feb 13 00:10:53 2007
New Revision: 506901

URL: http://svn.apache.org/viewvc?view=rev&rev=506901
Log:
Apply patch for HARMONY-3140:
[classlib][luni] test org.apache.harmony.luni.tests.java.lang.ClassLoaderTest intermittently
hang up

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java?view=diff&rev=506901&r1=506900&r2=506901
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
Tue Feb 13 00:10:53 2007
@@ -30,6 +30,8 @@
 
 public class ClassLoaderTest extends TestCase {
 
+    public static volatile int flag;
+
     /**
      * Tests that Classloader.defineClass() assigns appropriate 
      * default domains to the defined classes.
@@ -92,8 +94,10 @@
 
         protected Class findClass(String name) throws ClassNotFoundException {
             try {
-                synchronized (lock) {
-                    lock.wait();
+                while (flag != 2) {
+                    synchronized (lock) {
+                        lock.wait();
+                    }
                 }
             } catch (InterruptedException ie) {}
 
@@ -137,6 +141,7 @@
         SyncTestClassLoader cl = new SyncTestClassLoader(lock);
         SyncLoadTestThread tt1 = new SyncLoadTestThread(cl);
         SyncLoadTestThread tt2 = new SyncLoadTestThread(cl);
+        flag = 1;
         tt1.start();
         tt2.start();
 
@@ -144,6 +149,7 @@
             Thread.sleep(100);
         }
 
+        flag = 2;
         synchronized (lock) {
             lock.notifyAll();
         }



Mime
View raw message