coderzc commented on PR #18499:
URL: https://github.com/apache/pulsar/pull/18499#issuecomment-1318153620

   > The code above works well with the following outputs:
   
   You can try the following code, and will not be able to work well:
   ```java
   final var executor = Executors.newSingleThreadExecutor();
   executor.execute(() -> {
      final var latch = new CountDownLatch(1);
       executor.execute(() -> {
           System.out.println(Thread.currentThread().getName() + " 1");
           latch.countDown();
       });
       latch.await();
       System.out.println(Thread.currentThread().getName() + " 0");
   });
   executor.shutdown();
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to