On Wed, 27 Jan 2021 04:51:04 GMT, David Holmes <[email protected]> wrote:

> I thought the comments regarding the test were to use an if statement to 
> check iter.hasNext() and return after seeing one Monitor, rather than keeping 
> the while-loop and reporting every single Monitor found. The latter seems a 
> waste of timer as we don't know how many Monitors to expect, so it adds no 
> value to report them all.

I thought we should test whether we can get ObjectMonitor via SA at first - in 
other words, the test would pass when we get 1 ObjectMonitor at least.
However all of information of ObjectMonitors might be useful for diagnostic 
purposes as @dcubed-ojdk said. In this test, we use LingeredAppWithLock for 
debugee, so it will not waste time to iterate. (we might estimate num of locks 
we will observe: we can see 3 ObjectMonitors now)

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

PR: https://git.openjdk.java.net/jdk/pull/1910

Reply via email to