blob: 849d0cf1e44f9ab4bc866a02ae62d3a97dd65994 [file] [log] [blame]
<html lang="en">
<head>
<title>C99 Thread-Local Edits - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Thread_002dLocal.html#Thread_002dLocal" title="Thread-Local">
<link rel="next" href="C_002b_002b98-Thread_002dLocal-Edits.html#C_002b_002b98-Thread_002dLocal-Edits" title="C++98 Thread-Local Edits">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="C99-Thread-Local-Edits"></a>
<a name="C99-Thread_002dLocal-Edits"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="C_002b_002b98-Thread_002dLocal-Edits.html#C_002b_002b98-Thread_002dLocal-Edits">C++98 Thread-Local Edits</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Thread_002dLocal.html#Thread_002dLocal">Thread-Local</a>
<hr>
</div>
<h4 class="subsection">6.56.1 ISO/IEC 9899:1999 Edits for Thread-Local Storage</h4>
<p>The following are a set of changes to ISO/IEC 9899:1999 (aka C99)
that document the exact semantics of the language extension.
<ul>
<li><cite>5.1.2 Execution environments</cite>
<p>Add new text after paragraph 1
<blockquote>
Within either execution environment, a <dfn>thread</dfn> 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.
</blockquote>
<li><cite>6.2.4 Storage durations of objects</cite>
<p>Add new text before paragraph 3
<blockquote>
An object whose identifier is declared with the storage-class
specifier <code>__thread</code><!-- /@w --> has <dfn>thread storage duration</dfn>.
Its lifetime is the entire execution of the thread, and its
stored value is initialized only once, prior to thread startup.
</blockquote>
<li><cite>6.4.1 Keywords</cite>
<p>Add <code>__thread</code>.
<li><cite>6.7.1 Storage-class specifiers</cite>
<p>Add <code>__thread</code> to the list of storage class specifiers in
paragraph 1.
<p>Change paragraph 2 to
<blockquote>
With the exception of <code>__thread</code>, at most one storage-class
specifier may be given [<small class="dots">...</small>]. The <code>__thread</code> specifier may
be used alone, or immediately following <code>extern</code> or
<code>static</code>.
</blockquote>
<p>Add new text after paragraph 6
<blockquote>
The declaration of an identifier for a variable that has
block scope that specifies <code>__thread</code> shall also
specify either <code>extern</code> or <code>static</code>.
<p>The <code>__thread</code> specifier shall be used only with
variables.
</blockquote>
</ul>
</body></html>