Once the main thread has detected that the spawned thread is in the BLOCKED 
state, the spawned thread's LingeredAppWithLock.lockMethod() should be visible 
on the top of the stack, but it is not, so the "waiting to lock" message is 
missing from the stack trace.

I think the explanations mentioned in 
[JDK-8335124](https://bugs.openjdk.org/browse/JDK-8335124) and 
[JDK-8269881](https://bugs.openjdk.org/browse/JDK-8269881) apply here also. The 
state of the thread has moved to BLOCKED, but the thread still needs to finish 
making an OS call to actually become blocked and the thread become idle. During 
that time we may not be able to get an accurate stack trace. In this case 
probably SP has not been flushed, so we are not seeing the lockMethod() frame, 
which should appear at the top of the stack.

A short delay has been added after all threads have entered the desired state 
to make sure they have fully reached the desired state and are now idle.

Tested with Tier1 CI and all svc test tasks for tier2 and tier5.

-------------

Commit messages:
 - Add a 1/2 second delay to make sure the threads have finished moving to the 
right state and and idle.

Changes: https://git.openjdk.org/jdk/pull/19953/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19953&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8313235
  Stats: 18 lines in 2 files changed: 17 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19953.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19953/head:pull/19953

PR: https://git.openjdk.org/jdk/pull/19953

Reply via email to