changeset 22125:2a674dbed65d

6772009: java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java test failed with 'Completed != 2' Reviewed-by: martin, dholmes Contributed-by: srikalyan.chandrashekar@oracle.com
author alanb
date Wed, 08 Jan 2014 13:08:20 +0000
parents 8a31f2817571
children 1109df36251e
files jdk/test/ProblemList.txt jdk/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java
diffstat 2 files changed, 3 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/ProblemList.txt	Wed Jan 08 12:59:57 2014 +0000
+++ b/jdk/test/ProblemList.txt	Wed Jan 08 13:08:20 2014 +0000
@@ -282,7 +282,4 @@
 
 # jdk_util
 
-# Filed 6772009
-java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
-
 ############################################################################
--- a/jdk/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java	Wed Jan 08 12:59:57 2014 +0000
+++ b/jdk/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java	Wed Jan 08 13:08:20 2014 +0000
@@ -49,14 +49,11 @@
 public final class CancelledLockLoops {
     static final Random rng = new Random();
     static boolean print = false;
-    static final int ITERS = 1000000;
+    static final int ITERS = 5000000;
     static final long TIMEOUT = 100;
 
     public static void main(String[] args) throws Exception {
-        int maxThreads = 5;
-        if (args.length > 0)
-            maxThreads = Integer.parseInt(args[0]);
-
+        int maxThreads = (args.length > 0) ? Integer.parseInt(args[0]) : 5;
         print = true;
 
         for (int i = 2; i <= maxThreads; i += (i+1) >>> 1) {
@@ -90,7 +87,7 @@
                 threads[i] = new Thread(this);
             for (int i = 0; i < threads.length; ++i)
                 threads[i].start();
-            Thread[] cancels = (Thread[]) (threads.clone());
+            Thread[] cancels = threads.clone();
             Collections.shuffle(Arrays.asList(cancels), rng);
             barrier.await();
             Thread.sleep(TIMEOUT);