#
All variables declared with the
thread_
local
keyword have
thread storage duration
.
The storage for these entities lasts 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
#
[
Note
1
:
A variable with thread storage duration is initialized as specified in
[basic.
start.
static]
,
[basic.
start.
dynamic]
, and
[stmt.
dcl]
and, if constructed, is destroyed on thread exit (
[basic.
start.
term]
)
.
—
end note
]