6
Basic concepts
[basic]
6.7
Storage duration
[basic.stc]
6.7.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 (
[basic.def.odr]
) and, if constructed, shall be destroyed on thread exit
.