changeset 286:bec0afa5489c

Regression: Persist benchmark between multiple consequtive forks.
author shade
date Mon, 02 Dec 2013 17:35:24 +0400
parents 5736954ce7ab
children 332e380452df
files jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java	Mon Dec 02 17:10:24 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java	Mon Dec 02 17:35:24 2013 +0400
@@ -138,9 +138,7 @@
     }
 
     public void setCurrentBenchmark(BenchmarkRecord benchmark) {
-        if (!this.benchmark.compareAndSet(null, benchmark)) {
-            throw new IllegalStateException("Benchmark is already set");
-        }
+        this.benchmark.set(benchmark);
     }
 
     private final class Acceptor extends Thread {
@@ -266,7 +264,7 @@
                     oos.flush();
                     break;
                 case BENCHMARK_REQUEST:
-                    oos.writeObject(new BenchmarkRecordFrame(benchmark.getAndSet(null)));
+                    oos.writeObject(new BenchmarkRecordFrame(benchmark.get()));
                     oos.flush();
                     break;
                 default: