RFR: 8282721: HotSpot Style Guide should allow considered use of C++ thread_local [v3]

David Holmes dholmes at openjdk.java.net
Fri Mar 11 06:35:32 UTC 2022


On Thu, 10 Mar 2022 16:02:01 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Move new sentence to 'rationale' paragraph.
>
> doc/hotspot-style.md line 669:
> 
>> 667: initialization.  Dynamic initialization and destruction of
>> 668: namespace-scoped thread local variables also has the same ordering
>> 669: problems as for ordinary namespace-scoped variables. So we avoid use of
> 
> Should be s/namespace-scoped/non-local/ (two places).  This was overlooked by JDK-8272691.  (Mea culpa.) And yes, "non-local thread local"  (or "non-local thread-local") looks a little weird.  The standard (almost) doesn't use "thread-local" as a term, instead talking about variables with "thread storage duration".

Fixed. And I changed "thread local" to "`thread_local` for consistency and avoid the weirdness.

> doc/hotspot-style.md line 671:
> 
>> 669: problems as for ordinary namespace-scoped variables. So we avoid use of
>> 670: `thread_local` in general, limiting its use to only those cases where dynamic
>> 671: initialization and destruction are essential. See
> 
> Consider s/and/or/.

Changed

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

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


More information about the hotspot-dev mailing list