On Thu, 29 Jun 2023 14:26:10 GMT, Serguei Spitsyn <[email protected]> wrote:
>> Alex Menkov has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> spurious wakeups
>
> test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/GetThreadStateMountedTest.java
> line 62:
>
>> 60: TestStatus status = new
>> TestStatus("JVMTI_THREAD_STATE_RUNNABLE");
>> 61: CountDownLatch ready = new CountDownLatch(1);
>> 62: final boolean[] stopFlag = new boolean[1];
>
> Q: It is not clear why an array is needed instead of non-final local. The
> same question for `waiting()` method below. I'm thinking if reverting the
> flag to something like `needContinue` would simplify code a little bit.
It's used in lambda, so must be final
I think both "flag to stop" and "flag to continue" are clear, I prefer "flag to
stop" as it does not require additional initialization
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14622#discussion_r1246990707