RFR: 8271514: support JFR use of new ThreadsList::Iterator [v2]

David Holmes dholmes at openjdk.java.net
Thu Aug 5 05:47:28 UTC 2021


On Thu, 5 Aug 2021 04:00:25 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> The _tlist is used locally in JfrJavaThreadIteratorAdapter constructor only, so it is possible to get rid of it for the price of complicating the constructor a little bit.
>
> The `_tlist` is a handle that ensures the captured ThreadsList remains live while the iterator (or a copy) exists.  Dropping it would leave `_it` and `_end` potentially dangling.

Okay I had assumed there was a ThreadsList/Handle in the enclosing scope that was being used to initialize this and keep things live, but that is not the case.
I still think it makes no sense to have a StackObj subtype as a member though. Maybe ThreadsListHandle should no longer be a StackObj ?

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

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


More information about the serviceability-dev mailing list