6
Basics
[basic]
6.6
Memory and objects
[basic.memobj]
6.6.4
Storage duration
[basic.stc]
6.6.4.2
Thread storage duration
[basic.stc.thread]
1
#
All variables declared with the
thread_local
keyword have
thread storage duration
.
The storage for these entities shall last for the duration of the thread in which they are created
.
There is a distinct object or reference per thread, and use of the declared name refers to the entity associated with the current thread
.
2
#
A variable with thread storage duration shall be initialized before its first
odr-use
and, if constructed, shall be destroyed on thread exit
.