21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.event.runtime;
27
28 import static jdk.test.lib.Asserts.assertFalse;
29 import static jdk.test.lib.Asserts.assertTrue;
30
31 import java.time.Duration;
32 import java.util.concurrent.CountDownLatch;
33
34 import jdk.jfr.Recording;
35 import jdk.jfr.consumer.RecordedEvent;
36 import jdk.test.lib.jfr.EventNames;
37 import jdk.test.lib.jfr.Events;
38 import jdk.test.lib.thread.TestThread;
39 import jdk.test.lib.thread.XRun;
40
41 /*
42 * @test
43 * @key jfr
44 * @library /test/lib
45 * @run main/othervm jdk.jfr.event.runtime.TestJavaMonitorWaitEvent
46 */
47 public class TestJavaMonitorWaitEvent {
48
49 private final static String EVENT_NAME = EventNames.JavaMonitorWait;
50 private static final long WAIT_TIME = 123456;
51
52 static class Lock {
53 }
54
55 static boolean silenceFindBugsNakedNotify;
56
57 public static void main(String[] args) throws Throwable {
58 Recording recording = new Recording();
59 recording.enable(EVENT_NAME).withThreshold(Duration.ofMillis(0));
60
61 final Lock lock = new Lock();
62 final CountDownLatch latch = new CountDownLatch(1);
63
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.event.runtime;
27
28 import static jdk.test.lib.Asserts.assertFalse;
29 import static jdk.test.lib.Asserts.assertTrue;
30
31 import java.time.Duration;
32 import java.util.concurrent.CountDownLatch;
33
34 import jdk.jfr.Recording;
35 import jdk.jfr.consumer.RecordedEvent;
36 import jdk.test.lib.jfr.EventNames;
37 import jdk.test.lib.jfr.Events;
38 import jdk.test.lib.thread.TestThread;
39 import jdk.test.lib.thread.XRun;
40
41 /**
42 * @test
43 * @key jfr
44 * @requires vm.hasJFR
45 * @library /test/lib
46 * @run main/othervm jdk.jfr.event.runtime.TestJavaMonitorWaitEvent
47 */
48 public class TestJavaMonitorWaitEvent {
49
50 private final static String EVENT_NAME = EventNames.JavaMonitorWait;
51 private static final long WAIT_TIME = 123456;
52
53 static class Lock {
54 }
55
56 static boolean silenceFindBugsNakedNotify;
57
58 public static void main(String[] args) throws Throwable {
59 Recording recording = new Recording();
60 recording.enable(EVENT_NAME).withThreshold(Duration.ofMillis(0));
61
62 final Lock lock = new Lock();
63 final CountDownLatch latch = new CountDownLatch(1);
64
|