RFR: 8271513: support JavaThreadIteratorWithHandle replacement by new ThreadsList::Iterator

Kim Barrett kbarrett at openjdk.java.net
Mon Aug 2 11:16:32 UTC 2021


On Mon, 2 Aug 2021 04:11:35 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> A trivial fix to support JavaThreadIteratorWithHandle replacement by new ThreadsList::Iterator.
>> 
>> This fix was tested with Mach5 Tier[1-3].
>
> 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.

It's a type alias, which in this simple form is just like a typedef.  Type aliases can also have template parameters.  The iterator type used for iterating over a ThreadsListHandle today happens to be the same type as used for iterating over the underlying ThreadsList.  There's no particular reason to wire that information in to clients.

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

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


More information about the hotspot-runtime-dev mailing list