changeset 294:806179cda48d

Chapter 1.b: Remove stale template.
author shade
date Fri, 10 Jun 2016 14:29:27 +0300
parents 3a067ac9ecac
children ed33da548c5c
files jcstress-test-gen/src/main/resources/chapter1b/byteBuffer/StoreLoadFenceTestWeak.java.template
diffstat 1 files changed, 0 insertions(+), 97 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-test-gen/src/main/resources/chapter1b/byteBuffer/StoreLoadFenceTestWeak.java.template	Fri Jun 10 13:51:01 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2016, 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 $package$;
-
-import java.lang.invoke.MethodHandles;
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.VarHandle;
-import java.util.Random;
-import java.nio.ByteBuffer;
-
-import org.openjdk.jcstress.annotations.Actor;
-import org.openjdk.jcstress.annotations.Arbiter;
-import org.openjdk.jcstress.annotations.Expect;
-import org.openjdk.jcstress.annotations.JCStressTest;
-import org.openjdk.jcstress.annotations.Outcome;
-import org.openjdk.jcstress.annotations.Ref;
-import org.openjdk.jcstress.annotations.State;
-import org.openjdk.jcstress.annotations.Description;
-import org.openjdk.jcstress.infra.results.$Type$Result3;
-
-
-@JCStressTest
-@Description("weakCompareAndSetVolatile can take effect of store load fence, but may fail spuriously, so has different Outcomes with common StoreLoadFenceTest.")
-//when weak cas succeed
-@Outcome(id = "$value1$, $value0$, $value1$", expect = Expect.ACCEPTABLE, desc = "actor1 observe actor2 update, actor2 not yet observe actor1 update")
-@Outcome(id = "$value0$, $value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "actor2 observe actor1 update, actor1 not yet observe actor2 update")
-@Outcome(id = "$value1$, $value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "both actor1 and actor2 observe each other update")
-@Outcome(id = "$value0$, $value0$, $value1$", expect = Expect.FORBIDDEN, desc = "if r1 = 0, store var must be submitted already before fullFence in actor2, r2 must get the update")
-//when weak cas fail, r2 can only be $value0$
-@Outcome(id = "$value0$, $value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "actor1 not observe x is updated")
-@Outcome(id = "$value1$, $value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "actor1 observe x is updated")
-#if[alwaysAtomic]
-@Outcome(expect = Expect.FORBIDDEN, desc = "Other values are forbidden: atomicity violation.")
-#else[alwaysAtomic]
-//when weak cas succeed, if r1 is half-value or value0, store var is submitted before fullFence in actor2, r2 must be full-value, vice versa.
-@Outcome(id = "$value1$, .*, $value1$", expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec.")
-@Outcome(id = ".*, $value1$, $value1$", expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec")
-//when weak cas fail
-@Outcome(id = ".*, $value0$, $value0$", expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec, r1 may read half of x")
-@Ref("http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7")
-#end[alwaysAtomic]
-@State
-public class $TestClassName$ {
-
-    static final int OFF = ByteBuffer.wrap(new byte[128]).alignmentOffset(0, 8);
-
-    static final VarHandle vh;
-
-    static {
-        try {
-            vh = MethodHandles.byteBufferViewVarHandle($type$[].class, BIG_ENDIAN);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    ByteBuffer byteBuffer = $buffer_allocate$(OFF + 8);
-
-    $type$ x;
-
-    @Actor
-    public void actor1($Type$Result3 r) {
-        boolean result = %WeakSetStoreLoadFence<$valueLiteral1$>%
-        r.r1 = x;
-        r.r3 = result ? $valueLiteral1$ : $valueLiteral0$;
-    }
-
-    @Actor
-    public void actor2($Type$Result3 r) {
-        x = $valueLiteral1$;
-        VarHandle.fullFence();
-        r.r2 = ($type$) vh.get(byteBuffer, OFF);
-    }
-}
\ No newline at end of file