summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/c_002b_002b98-thread-local-edits.html
blob: 52bc84dacbb2df922fb627de63aadbd9006ae2b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<div class="subsection-level-extent" id="C_002b_002b98-Thread-Local-Edits"> <div class="nav-panel"> <p> Previous: <a href="c99-thread-local-edits" accesskey="p" rel="prev">ISO/IEC 9899:1999 Edits for Thread-Local Storage</a>, Up: <a href="thread-local" accesskey="u" rel="up">Thread-Local Storage</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div>  <h1 class="subsection" id="ISO_002fIEC-14882_003a1998-Edits-for-Thread-Local-Storage"><span>6.64.2 ISO/IEC 14882:1998 Edits for Thread-Local Storage<a class="copiable-link" href="#ISO_002fIEC-14882_003a1998-Edits-for-Thread-Local-Storage"> ¶</a></span></h1> <p>The following are a set of changes to ISO/IEC 14882:1998 (aka C++98) that document the exact semantics of the language extension. </p> <ul class="itemize mark-bullet"> <li>
<b class="b">[intro.execution]</b> <p>New text after paragraph 4 </p> <blockquote class="quotation"> <p>A <em class="dfn">thread</em> is a flow of control within the abstract machine. It is implementation defined whether or not there may be more than one thread. </p>
</blockquote> <p>New text after paragraph 7 </p> <blockquote class="quotation"> <p>It is unspecified whether additional action must be taken to ensure when and whether side effects are visible to other threads. </p>
</blockquote> </li>
<li>
<b class="b">[lex.key]</b> <p>Add <code class="code">__thread</code>. </p> </li>
<li>
<b class="b">[basic.start.main]</b> <p>Add after paragraph 5 </p> <blockquote class="quotation"> <p>The thread that begins execution at the <code class="code">main</code> function is called the <em class="dfn">main thread</em>. It is implementation defined how functions beginning threads other than the main thread are designated or typed. A function so designated, as well as the <code class="code">main</code> function, is called a <em class="dfn">thread startup function</em>. It is implementation defined what happens if a thread startup function returns. It is implementation defined what happens to other threads when any thread calls <code class="code">exit</code>. </p>
</blockquote> </li>
<li>
<b class="b">[basic.start.init]</b> <p>Add after paragraph 4 </p> <blockquote class="quotation"> <p>The storage for an object of thread storage duration shall be statically initialized before the first statement of the thread startup function. An object of thread storage duration shall not require dynamic initialization. </p>
</blockquote> </li>
<li>
<b class="b">[basic.start.term]</b> <p>Add after paragraph 3 </p> <blockquote class="quotation"> <p>The type of an object with thread storage duration shall not have a non-trivial destructor, nor shall it be an array type whose elements (directly or indirectly) have non-trivial destructors. </p>
</blockquote> </li>
<li>
<b class="b">[basic.stc]</b> <p>Add “thread storage duration” to the list in paragraph 1. </p> <p>Change paragraph 2 </p> <blockquote class="quotation"> <p>Thread, static, and automatic storage durations are associated with objects introduced by declarations […]. </p>
</blockquote> <p>Add <code class="code">__thread</code> to the list of specifiers in paragraph 3. </p> </li>
<li>
<b class="b">[basic.stc.thread]</b> <p>New section before <b class="b">[basic.stc.static]</b> </p> <blockquote class="quotation"> <p>The keyword <code class="code">__thread</code> applied to a non-local object gives the object thread storage duration. </p> <p>A local variable or class data member declared both <code class="code">static</code> and <code class="code">__thread</code> gives the variable or member thread storage duration. </p>
</blockquote> </li>
<li>
<b class="b">[basic.stc.static]</b> <p>Change paragraph 1 </p> <blockquote class="quotation"> <p>All objects that have neither thread storage duration, dynamic storage duration nor are local […]. </p>
</blockquote> </li>
<li>
<b class="b">[dcl.stc]</b> <p>Add <code class="code">__thread</code> to the list in paragraph 1. </p> <p>Change paragraph 1 </p> <blockquote class="quotation"> <p>With the exception of <code class="code">__thread</code>, at most one <var class="var">storage-class-specifier</var> shall appear in a given <var class="var">decl-specifier-seq</var>. The <code class="code">__thread</code> specifier may be used alone, or immediately following the <code class="code">extern</code> or <code class="code">static</code> specifiers. […] </p>
</blockquote> <p>Add after paragraph 5 </p> <blockquote class="quotation"> <p>The <code class="code">__thread</code> specifier can be applied only to the names of objects and to anonymous unions. </p>
</blockquote> </li>
<li>
<b class="b">[class.mem]</b> <p>Add after paragraph 6 </p> <blockquote class="quotation"> <p>Non-<code class="code">static</code> members shall not be <code class="code">__thread</code>. </p>
</blockquote> </li>
</ul> </div>  <div class="nav-panel"> <p> Previous: <a href="c99-thread-local-edits">ISO/IEC 9899:1999 Edits for Thread-Local Storage</a>, Up: <a href="thread-local">Thread-Local Storage</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
  <p class="_attribution-p">
    &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
    <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/C_002b_002b98-Thread-Local-Edits.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/C_002b_002b98-Thread-Local-Edits.html</a>
  </p>
</div>