< prev index next >

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

Print this page

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

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

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