On Tue, 24 May 2022 19:52:57 GMT, Leonid Mesnik <lmes...@openjdk.org> wrote:
> Need to use proper synchronization. > > The CyclicBarriers might move the thread to WAITING state but not BLOCKED. So > it should not confuse existing checks. test/jdk/java/lang/management/ThreadMXBean/VirtualThreadDeadlocks.java line 98: > 96: > 97: private static void awaitBlocked(Thread thread) throws > InterruptedException { > 98: while (thread.getState() != Thread.State.BLOCKED) { Thread.State.BLOCKED == thread.getState(). Does it make sense? test/jdk/java/lang/management/ThreadMXBean/VirtualThreadDeadlocks.java line 100: > 98: while (thread.getState() != Thread.State.BLOCKED) { > 99: Thread.sleep(10); > 100: if (thread.getState() == Thread.State.TERMINATED) { Thread.State.TERMINATED == thread.getState(). Does it make sense? ------------- PR: https://git.openjdk.java.net/jdk/pull/8874