< prev index next >

test/hotspot/jtreg/serviceability/jvmti/ObjectMonitorUsage/ObjectMonitorUsage.java

Print this page

268             }
269         }
270         joinThreads(wThreads);
271         joinThreads(eThreads);
272         setTestedMonitor(null);
273         log("### test3: finished " + vtag);
274     }
275 
276     static void test(boolean isVirtual) {
277         test0(isVirtual);
278         test1(isVirtual);
279         test2(isVirtual);
280         test3(isVirtual);
281     }
282 
283     public static void main(String args[]) {
284         log("\n### main: started\n");
285         check(lockCheck, null, 0, 0, 0);
286 
287         test(false); // test platform threads
288         test(true);  // test virtual threads

289 
290         check(lockCheck, null, 0, 0, 0);
291         if (getRes() > 0) {
292             throw new RuntimeException("Failed status returned from the agent");
293         }
294         log("\n### main: finished\n");
295     }
296 
297     static abstract class TestTask implements Runnable {
298         volatile boolean ready = false;
299         String name;
300 
301         public abstract void run();
302 
303         String getName() { return name; }
304         void setName(String name) { this.name = name; }
305 
306         void waitReady() {
307             try {
308                 while (!ready) {

268             }
269         }
270         joinThreads(wThreads);
271         joinThreads(eThreads);
272         setTestedMonitor(null);
273         log("### test3: finished " + vtag);
274     }
275 
276     static void test(boolean isVirtual) {
277         test0(isVirtual);
278         test1(isVirtual);
279         test2(isVirtual);
280         test3(isVirtual);
281     }
282 
283     public static void main(String args[]) {
284         log("\n### main: started\n");
285         check(lockCheck, null, 0, 0, 0);
286 
287         test(false); // test platform threads
288 
289         //test(true);  // test virtual threads
290 
291         check(lockCheck, null, 0, 0, 0);
292         if (getRes() > 0) {
293             throw new RuntimeException("Failed status returned from the agent");
294         }
295         log("\n### main: finished\n");
296     }
297 
298     static abstract class TestTask implements Runnable {
299         volatile boolean ready = false;
300         String name;
301 
302         public abstract void run();
303 
304         String getName() { return name; }
305         void setName(String name) { this.name = name; }
306 
307         void waitReady() {
308             try {
309                 while (!ready) {
< prev index next >