提交 3e95dbf4 编写于 作者: A alanb

6772009: java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java test...

6772009: java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java test failed with 'Completed != 2'
Reviewed-by: martin, dholmes
Contributed-by: srikalyan.chandrashekar@oracle.com
上级 03486780
......@@ -275,9 +275,6 @@ tools/launcher/FXLauncherTest.java linux-all
# jdk_util
# Filed 6772009
java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
############################################################################
# svc_tools
......
......@@ -49,14 +49,11 @@ import java.util.*;
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 @@ public final class CancelledLockLoops {
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册