On Sat, 15 Apr 2023 02:38:11 GMT, David Holmes <dhol...@openjdk.org> wrote:
> I don't think you want to add `afterSleep` as that means the thread woke too > soon and we may need to adjust the sleep time. - so we would want that to > fail. If I read the test correctly, "RunningThread" does recursive calls and eventually calls waitForSign where it spins calling Thread.sleep(1). The observer calling java.lang.management.ThreadInfo::getStackTrace could sample the thread in Thread.sleep at any time so I think it may see afterSleep in the stack. I don't know if there is any value doing this, would it loose anything to ignore any frames deeper than Thread.sleep(long)? ------------- PR Comment: https://git.openjdk.org/jdk/pull/13476#issuecomment-1510169356