test/jdk/jdk/jfr/api/consumer/recordingstream/TestClose.java
branchJEP-349-branch
changeset 58129 7b751fe181a5
parent 57361 53dccc90a5be
child 58271 e47423f1318b
equal deleted inserted replaced
58121:6f8f18ac1d54 58129:7b751fe181a5
    76     private static void testCloseStreaming() throws Exception {
    76     private static void testCloseStreaming() throws Exception {
    77         CountDownLatch streaming = new CountDownLatch(1);
    77         CountDownLatch streaming = new CountDownLatch(1);
    78         RecordingStream r = new RecordingStream();
    78         RecordingStream r = new RecordingStream();
    79         AtomicLong count = new AtomicLong();
    79         AtomicLong count = new AtomicLong();
    80         r.onEvent(e -> {
    80         r.onEvent(e -> {
    81             if (count.incrementAndGet() == 100) {
    81             if (count.incrementAndGet() > 100) {
    82                 streaming.countDown();
    82                 streaming.countDown();
    83             }
    83             }
    84         });
    84         });
    85         r.startAsync();
    85         r.startAsync();
    86         var streamingLoop = CompletableFuture.runAsync(() -> {
    86         var streamingLoop = CompletableFuture.runAsync(() -> {