equal
deleted
inserted
replaced
115 return this.getClass().getName() + "::lock"; |
115 return this.getClass().getName() + "::lock"; |
116 } |
116 } |
117 |
117 |
118 @Override |
118 @Override |
119 public String[] getMethodsToCompileNames() { |
119 public String[] getMethodsToCompileNames() { |
120 return new String[] { |
120 return new String[] { getMethodWithLockName() }; |
121 getMethodWithLockName() |
|
122 }; |
|
123 } |
121 } |
124 |
122 |
125 public void lock() { |
123 public void lock() { |
126 synchronized(monitor) { |
124 synchronized(monitor) { |
127 Test.field++; |
125 Test.field++; |
133 * Test <inflate monitor> |
131 * Test <inflate monitor> |
134 */ |
132 */ |
135 public static void main(String args[]) throws Throwable { |
133 public static void main(String args[]) throws Throwable { |
136 Asserts.assertGTE(args.length, 1, "One argument required."); |
134 Asserts.assertGTE(args.length, 1, "One argument required."); |
137 Test test = new Test(); |
135 Test test = new Test(); |
138 |
136 boolean shouldBeInflated = Boolean.valueOf(args[0]); |
139 if (Boolean.valueOf(args[0])) { |
137 if (shouldBeInflated) { |
140 AbortProvoker.inflateMonitor(test.monitor); |
138 AbortProvoker.inflateMonitor(test.monitor); |
141 } |
139 } |
142 for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) { |
140 for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) { |
|
141 AbortProvoker.verifyMonitorState(test.monitor, |
|
142 shouldBeInflated); |
143 test.lock(); |
143 test.lock(); |
144 } |
144 } |
145 } |
145 } |
146 } |
146 } |
147 |
147 |