RFR: 8271513: support JavaThreadIteratorWithHandle replacement by new ThreadsList::Iterator
David Holmes
dholmes at openjdk.java.net
Mon Aug 2 04:27:32 UTC 2021
On Fri, 30 Jul 2021 19:19:49 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
> A trivial fix to support JavaThreadIteratorWithHandle replacement by new ThreadsList::Iterator.
>
> This fix was tested with Mach5 Tier[1-3].
Sorry Dan, while I like the use of the for-each loops very much I don't understand the details of the iterator declaration. I definitely do not classify this as a trivial change.
Thanks,
David
src/hotspot/share/runtime/threadSMR.hpp line 331:
> 329: }
> 330:
> 331: using Iterator = ThreadsList::Iterator;
Is this like a typedef? I don't think I want to see plain "Iterator" and not know what the actual type is here.
src/hotspot/share/runtime/threadSMR.inline.hpp line 110:
> 108: }
> 109:
> 110: ThreadsListHandle::Iterator ThreadsListHandle::begin() { return list()->begin(); }
I don't understand this - why is the return type not `ThreadsList::Iterator` as per the declaration in the hpp file? That `using` directive is apparently doing something more bizarre than I thought.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4948
More information about the hotspot-runtime-dev
mailing list