Mercurial > hg > truffle
annotate test/compiler/testlibrary/rtm/AbortProvoker.java @ 20750:401cbaa475b4 jdk8u31-b03
Added tag jdk8u31-b02 for changeset 087678da9660
author | asaha |
---|---|
date | Mon, 29 Sep 2014 11:49:45 -0700 |
parents | 665bbe93823f |
children |
rev | line source |
---|---|
17871
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
1 /* |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
4 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
8 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
13 * accompanied this code). |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
14 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
18 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
21 * questions. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
22 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
23 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
24 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
25 package rtm; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
26 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
27 import java.util.Objects; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
28 import java.util.concurrent.BrokenBarrierException; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
29 import java.util.concurrent.CyclicBarrier; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
30 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
31 import com.oracle.java.testlibrary.Asserts; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
32 import com.oracle.java.testlibrary.Utils; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
33 import sun.misc.Unsafe; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
34 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
35 /** |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
36 * Base class for different transactional execution abortion |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
37 * provokers aimed to force abort due to specified reason. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
38 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
39 public abstract class AbortProvoker implements CompilableTest { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
40 public static final long DEFAULT_ITERATIONS = 10000L; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
41 /** |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
42 * Inflates monitor associated with object {@code monitor}. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
43 * Inflation is forced by entering the same monitor from |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
44 * two different threads. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
45 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
46 * @param monitor monitor to be inflated. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
47 * @return inflated monitor. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
48 * @throws Exception if something went wrong. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
49 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
50 public static Object inflateMonitor(Object monitor) throws Exception { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
51 Unsafe unsafe = Utils.getUnsafe(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
52 CyclicBarrier barrier = new CyclicBarrier(2); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
53 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
54 Runnable inflatingRunnable = () -> { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
55 unsafe.monitorEnter(monitor); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
56 try { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
57 barrier.await(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
58 barrier.await(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
59 } catch (InterruptedException | BrokenBarrierException e) { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
60 throw new RuntimeException( |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
61 "Synchronization issue occurred.", e); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
62 } finally { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
63 unsafe.monitorExit(monitor); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
64 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
65 }; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
66 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
67 Thread t = new Thread(inflatingRunnable); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
68 t.start(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
69 // Wait until thread t enters the monitor. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
70 barrier.await(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
71 // At this point monitor will be owned by thread t, |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
72 // so our attempt to enter the same monitor will force |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
73 // monitor inflation. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
74 Asserts.assertFalse(unsafe.tryMonitorEnter(monitor), |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
75 "Not supposed to enter the monitor first"); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
76 barrier.await(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
77 t.join(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
78 return monitor; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
79 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
80 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
81 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
82 /** |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
83 * Get instance of specified AbortProvoker, inflate associated monitor |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
84 * if needed and then invoke forceAbort method in a loop. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
85 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
86 * Usage: |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
87 * AbortProvoker <AbortType name> [<inflate monitor> |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
88 * [<iterations> [ <delay>]]] |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
89 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
90 * Default parameters are: |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
91 * <ul> |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
92 * <li>inflate monitor = <b>true</b></li> |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
93 * <li>iterations = {@code AbortProvoker.DEFAULT_ITERATIONS}</li> |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
94 * <li>delay = <b>0</b></li> |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
95 * </ul> |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
96 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
97 public static void main(String args[]) throws Throwable { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
98 Asserts.assertGT(args.length, 0, "At least one argument is required."); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
99 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
100 AbortType abortType = AbortType.lookup(Integer.valueOf(args[0])); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
101 boolean monitorShouldBeInflated = true; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
102 long iterations = AbortProvoker.DEFAULT_ITERATIONS; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
103 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
104 if (args.length > 1) { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
105 monitorShouldBeInflated = Boolean.valueOf(args[1]); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
106 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
107 if (args.length > 2) { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
108 iterations = Long.valueOf(args[2]); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
109 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
110 if (args.length > 3) { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
111 Thread.sleep(Integer.valueOf(args[3])); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
112 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
113 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
114 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
115 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
116 AbortProvoker provoker = abortType.provoker(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
117 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
118 if (monitorShouldBeInflated) { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
119 provoker.inflateMonitor(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
120 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
121 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
122 for (long i = 0; i < iterations; i++) { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
123 provoker.forceAbort(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
124 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
125 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
126 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
127 protected final Object monitor; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
128 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
129 protected AbortProvoker() { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
130 this(new Object()); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
131 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
132 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
133 protected AbortProvoker(Object monitor) { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
134 this.monitor = Objects.requireNonNull(monitor); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
135 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
136 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
137 /** |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
138 * Inflates monitor used by this AbortProvoker instance. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
139 * @throws Exception |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
140 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
141 public void inflateMonitor() throws Exception { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
142 AbortProvoker.inflateMonitor(monitor); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
143 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
144 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
145 /** |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
146 * Forces transactional execution abortion. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
147 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
148 public abstract void forceAbort(); |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
149 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
150 /** |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
151 * Returns names of all methods that have to be compiled |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
152 * in order to successfully force transactional execution |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
153 * abortion. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
154 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
155 * @return array with methods' names that have to be compiled. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
156 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
157 @Override |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
158 public String[] getMethodsToCompileNames() { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
159 return new String[] { getMethodWithLockName() }; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
160 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
161 |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
162 /** |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
163 * Returns name of the method that will contain monitor whose locking |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
164 * will be elided using transactional execution. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
165 * |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
166 * @return name of the method that will contain elided lock. |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
167 */ |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
168 @Override |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
169 public String getMethodWithLockName() { |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
170 return this.getClass().getName() + "::forceAbort"; |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
171 } |
665bbe93823f
8039499: Add all common classes used by tests on RTM support to testlibrary
iignatyev
parents:
diff
changeset
|
172 } |