On Wed, 25 May 2022 21:18:24 GMT, master-code-java <[email protected]>
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?
Do you mean '==' or '!='? Both don't make sense to me, honestly. Could you
please elaborate?
> 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?
Not sure. What is the goal?
-------------
PR: https://git.openjdk.java.net/jdk/pull/8874