On Wed, 9 Jun 2021 22:11:28 GMT, Serguei Spitsyn <[email protected]> wrote:
> The test is intermittently failing because the tested thread thrstat002a is
> blocked on a monitor in the PrintStream.println(String) when it is expected
> to be in the RUNNABLE state:
> thrstat002.runningBarrier.unlock(); <= now the thrstat002 state can be
> checked and suspend issued
> System.out.println("thrstat002a.run after runningBarrier unlock"); <=
> blocked on the monitor in here
>
> The fix is to move println line to the point before
> thrstat002.runningBarrier.unlock();
> Also, a fflush(0) statement is added to the agent *_checkStatus() function to
> get output better sync'ed.
This pull request has now been integrated.
Changeset: dd1cbadc
Author: Serguei Spitsyn <[email protected]>
URL:
https://git.openjdk.java.net/jdk/commit/dd1cbadc82bcecf718b96c833a5845fde79db061
Stats: 7 lines in 2 files changed: 4 ins; 0 del; 3 mod
8268285: vmTestbase/nsk/jvmti/GetThreadState/thrstat002 failed with "Wrong
thread "thr1" (...) state after SuspendThread"
Reviewed-by: lmesnik, amenkov, dholmes
-------------
PR: https://git.openjdk.java.net/jdk/pull/4447