The following are a set of changes to ISO/IEC 9899:1999 (aka C99) that document the exact semantics of the language extension.
Add new text after paragraph 1
Within either execution environment, a thread is a flow of control within a program. It is implementation defined whether or not there may be more than one thread associated with a program. It is implementation defined how threads beyond the first are created, the name and type of the function called at thread startup, and how threads may be terminated. However, objects with thread storage duration shall be initialized before thread startup.
Add new text before paragraph 3
An object whose identifier is declared with the storage-class specifier __thread
has thread storage duration. Its lifetime is the entire execution of the thread, and its stored value is initialized only once, prior to thread startup.
Add __thread
.
Add __thread
to the list of storage class specifiers in paragraph 1.
Change paragraph 2 to
With the exception of__thread
, at most one storage-class specifier may be given [...]. The__thread
specifier may be used alone, or immediately followingextern
orstatic
.
Add new text after paragraph 6
The declaration of an identifier for a variable that has block scope that specifies__thread
shall also specify eitherextern
orstatic
.The
__thread
specifier shall be used only with variables.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gcc/C99-Thread_002dLocal-Edits.html