You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

214 lines
7.6KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>C++98 Thread-Local Edits (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="C++98 Thread-Local Edits (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="C++98 Thread-Local Edits (Using the GNU Compiler Collection (GCC))">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Thread_002dLocal.html#Thread_002dLocal" rel="up" title="Thread-Local">
  30. <link href="Binary-constants.html#Binary-constants" rel="next" title="Binary constants">
  31. <link href="C99-Thread_002dLocal-Edits.html#C99-Thread_002dLocal-Edits" rel="prev" title="C99 Thread-Local Edits">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="C_002b_002b98-Thread_002dLocal-Edits"></a>
  62. <div class="header">
  63. <p>
  64. Previous: <a href="C99-Thread_002dLocal-Edits.html#C99-Thread_002dLocal-Edits" accesskey="p" rel="prev">C99 Thread-Local Edits</a>, Up: <a href="Thread_002dLocal.html#Thread_002dLocal" accesskey="u" rel="up">Thread-Local</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="ISO_002fIEC-14882_003a1998-Edits-for-Thread_002dLocal-Storage"></a>
  68. <h4 class="subsection">6.64.2 ISO/IEC 14882:1998 Edits for Thread-Local Storage</h4>
  69. <p>The following are a set of changes to ISO/IEC 14882:1998 (aka C++98)
  70. that document the exact semantics of the language extension.
  71. </p>
  72. <ul>
  73. <li> <b>[intro.execution]</b>
  74. <p>New text after paragraph 4
  75. </p>
  76. <blockquote>
  77. <p>A <em>thread</em> is a flow of control within the abstract machine.
  78. It is implementation defined whether or not there may be more than
  79. one thread.
  80. </p></blockquote>
  81. <p>New text after paragraph 7
  82. </p>
  83. <blockquote>
  84. <p>It is unspecified whether additional action must be taken to
  85. ensure when and whether side effects are visible to other threads.
  86. </p></blockquote>
  87. </li><li> <b>[lex.key]</b>
  88. <p>Add <code>__thread</code>.
  89. </p>
  90. </li><li> <b>[basic.start.main]</b>
  91. <p>Add after paragraph 5
  92. </p>
  93. <blockquote>
  94. <p>The thread that begins execution at the <code>main</code> function is called
  95. the <em>main thread</em>. It is implementation defined how functions
  96. beginning threads other than the main thread are designated or typed.
  97. A function so designated, as well as the <code>main</code> function, is called
  98. a <em>thread startup function</em>. It is implementation defined what
  99. happens if a thread startup function returns. It is implementation
  100. defined what happens to other threads when any thread calls <code>exit</code>.
  101. </p></blockquote>
  102. </li><li> <b>[basic.start.init]</b>
  103. <p>Add after paragraph 4
  104. </p>
  105. <blockquote>
  106. <p>The storage for an object of thread storage duration shall be
  107. statically initialized before the first statement of the thread startup
  108. function. An object of thread storage duration shall not require
  109. dynamic initialization.
  110. </p></blockquote>
  111. </li><li> <b>[basic.start.term]</b>
  112. <p>Add after paragraph 3
  113. </p>
  114. <blockquote>
  115. <p>The type of an object with thread storage duration shall not have a
  116. non-trivial destructor, nor shall it be an array type whose elements
  117. (directly or indirectly) have non-trivial destructors.
  118. </p></blockquote>
  119. </li><li> <b>[basic.stc]</b>
  120. <p>Add &ldquo;thread storage duration&rdquo; to the list in paragraph 1.
  121. </p>
  122. <p>Change paragraph 2
  123. </p>
  124. <blockquote>
  125. <p>Thread, static, and automatic storage durations are associated with
  126. objects introduced by declarations [&hellip;].
  127. </p></blockquote>
  128. <p>Add <code>__thread</code> to the list of specifiers in paragraph 3.
  129. </p>
  130. </li><li> <b>[basic.stc.thread]</b>
  131. <p>New section before <b>[basic.stc.static]</b>
  132. </p>
  133. <blockquote>
  134. <p>The keyword <code>__thread</code> applied to a non-local object gives the
  135. object thread storage duration.
  136. </p>
  137. <p>A local variable or class data member declared both <code>static</code>
  138. and <code>__thread</code> gives the variable or member thread storage
  139. duration.
  140. </p></blockquote>
  141. </li><li> <b>[basic.stc.static]</b>
  142. <p>Change paragraph 1
  143. </p>
  144. <blockquote>
  145. <p>All objects that have neither thread storage duration, dynamic
  146. storage duration nor are local [&hellip;].
  147. </p></blockquote>
  148. </li><li> <b>[dcl.stc]</b>
  149. <p>Add <code>__thread</code> to the list in paragraph 1.
  150. </p>
  151. <p>Change paragraph 1
  152. </p>
  153. <blockquote>
  154. <p>With the exception of <code>__thread</code>, at most one
  155. <var>storage-class-specifier</var> shall appear in a given
  156. <var>decl-specifier-seq</var>. The <code>__thread</code> specifier may
  157. be used alone, or immediately following the <code>extern</code> or
  158. <code>static</code> specifiers. [&hellip;]
  159. </p></blockquote>
  160. <p>Add after paragraph 5
  161. </p>
  162. <blockquote>
  163. <p>The <code>__thread</code> specifier can be applied only to the names of objects
  164. and to anonymous unions.
  165. </p></blockquote>
  166. </li><li> <b>[class.mem]</b>
  167. <p>Add after paragraph 6
  168. </p>
  169. <blockquote>
  170. <p>Non-<code>static</code> members shall not be <code>__thread</code>.
  171. </p></blockquote>
  172. </li></ul>
  173. <hr>
  174. <div class="header">
  175. <p>
  176. Previous: <a href="C99-Thread_002dLocal-Edits.html#C99-Thread_002dLocal-Edits" accesskey="p" rel="prev">C99 Thread-Local Edits</a>, Up: <a href="Thread_002dLocal.html#Thread_002dLocal" accesskey="u" rel="up">Thread-Local</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  177. </div>
  178. </body>
  179. </html>