changeset 81:4366e13c0e2a

ControlHolder -> Control
author shade
date Wed, 12 Mar 2014 23:58:32 +0400
parents ec966433b6be
children 8b1375bd1243
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/ActorBase.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Control.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/ControlHolder.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Runner.java
diffstat 4 files changed, 55 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/ActorBase.java	Wed Mar 12 23:57:52 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/ActorBase.java	Wed Mar 12 23:58:32 2014 +0400
@@ -27,7 +27,6 @@
 import org.openjdk.jcstress.infra.Result;
 import org.openjdk.jcstress.tests.ActorConcurrencyTest;
 import org.openjdk.jcstress.util.Counter;
-import org.openjdk.jcstress.util.UnsafeHolder;
 
 import java.util.Arrays;
 import java.util.concurrent.Callable;
@@ -49,10 +48,10 @@
     private final AtomicReference<StateHolder<S, R>> version;
     private final AtomicInteger epoch;
     private final Counter<R> counter;
-    private final ControlHolder control;
+    private final Control control;
     private final S[] poison;
 
-    public ActorBase(int index, T test, AtomicReference<StateHolder<S,R>> version, AtomicInteger epoch, Counter<R> counter, ControlHolder control, S[] poison) {
+    public ActorBase(int index, T test, AtomicReference<StateHolder<S,R>> version, AtomicInteger epoch, Counter<R> counter, Control control, S[] poison) {
         this.index = index;
         this.test = test;
         this.version = version;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Control.java	Wed Mar 12 23:58:32 2014 +0400
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.runners;
+
+import org.openjdk.jcstress.Options;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Control {
+    volatile boolean isStopped;
+    final boolean shouldYield;
+    final boolean verbose;
+    final int minStride;
+    final int maxStride;
+    final int time;
+    final int iters;
+    final int deoptRatio;
+
+    public Control(Options opts) {
+        time = opts.getTime();
+        minStride = opts.getMinStride();
+        maxStride = opts.getMaxStride();
+        iters = opts.getIterations();
+        shouldYield = opts.shouldYield();
+        verbose = opts.isVerbose();
+        deoptRatio = opts.deoptRatio();
+    }
+}
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/ControlHolder.java	Wed Mar 12 23:57:52 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jcstress.infra.runners;
-
-import org.openjdk.jcstress.Options;
-
-/**
- * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
- */
-public class ControlHolder {
-    volatile boolean isStopped;
-    final boolean shouldYield;
-    final boolean verbose;
-    final int minStride;
-    final int maxStride;
-    final int time;
-    final int iters;
-    final int deoptRatio;
-
-    public ControlHolder(Options opts) {
-        time = opts.getTime();
-        minStride = opts.getMinStride();
-        maxStride = opts.getMaxStride();
-        iters = opts.getIterations();
-        shouldYield = opts.shouldYield();
-        verbose = opts.isVerbose();
-        deoptRatio = opts.deoptRatio();
-    }
-}
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Runner.java	Wed Mar 12 23:57:52 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Runner.java	Wed Mar 12 23:58:32 2014 +0400
@@ -28,7 +28,6 @@
 import org.openjdk.jcstress.infra.Status;
 import org.openjdk.jcstress.infra.collectors.TestResult;
 import org.openjdk.jcstress.infra.collectors.TestResultCollector;
-import org.openjdk.jcstress.tests.ConcurrencyTest;
 import org.openjdk.jcstress.util.Counter;
 import org.openjdk.jcstress.util.NullOutputStream;
 
@@ -50,7 +49,7 @@
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
 public abstract class Runner {
-    protected final ControlHolder control;
+    protected final Control control;
     protected final TestResultCollector collector;
     protected final ExecutorService pool;
     protected final PrintWriter testLog;
@@ -58,7 +57,7 @@
     public Runner(Options opts, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
         this.collector = collector;
         this.pool = pool;
-        this.control = new ControlHolder(opts);
+        this.control = new Control(opts);
 
         if (control.verbose) {
             testLog = new PrintWriter(System.out, true);