gcc: C99 Thread-Local Edits

1 
1 6.63.1 ISO/IEC 9899:1999 Edits for Thread-Local Storage
1 -------------------------------------------------------
1 
1 The following are a set of changes to ISO/IEC 9899:1999 (aka C99) that
1 document the exact semantics of the language extension.
1 
1    * '5.1.2 Execution environments'
1 
1      Add new text after paragraph 1
1 
1           Within either execution environment, a "thread" is a flow of
1           control within a program.  It is implementation defined
1           whether or not there may be more than one thread associated
1           with a program.  It is implementation defined how threads
1           beyond the first are created, the name and type of the
1           function called at thread startup, and how threads may be
1           terminated.  However, objects with thread storage duration
1           shall be initialized before thread startup.
1 
1    * '6.2.4 Storage durations of objects'
1 
1      Add new text before paragraph 3
1 
1           An object whose identifier is declared with the storage-class
1           specifier '__thread' has "thread storage duration".  Its
1           lifetime is the entire execution of the thread, and its stored
1           value is initialized only once, prior to thread startup.
1 
1    * '6.4.1 Keywords'
1 
1      Add '__thread'.
1 
1    * '6.7.1 Storage-class specifiers'
1 
1      Add '__thread' to the list of storage class specifiers in paragraph
1      1.
1 
1      Change paragraph 2 to
1 
1           With the exception of '__thread', at most one storage-class
1           specifier may be given [...].  The '__thread' specifier may be
1           used alone, or immediately following 'extern' or 'static'.
1 
1      Add new text after paragraph 6
1 
1           The declaration of an identifier for a variable that has block
1           scope that specifies '__thread' shall also specify either
1           'extern' or 'static'.
1 
1           The '__thread' specifier shall be used only with variables.
1