⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c99-thread-local-edits.html

📁 gcc手册
💻 HTML
字号:
<html lang="en">

<head>

<title>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.3">

<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">

<!--

Copyright &copy; 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,

1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.



   <p>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 "GNU General Public License" and "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".



   <p>(a) The FSF's Front-Cover Text is:



   <p>A GNU Manual



   <p>(b) The FSF's Back-Cover Text is:



   <p>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.-->

</head>

<body>

<div class="node">

<p>

Node:<a name="C99%20Thread-Local%20Edits">C99 Thread-Local Edits</a>,

Next:<a rel="next" accesskey="n" href="C--98-Thread-Local-Edits.html#C++98%20Thread-Local%20Edits">C++98 Thread-Local Edits</a>,

Up:<a rel="up" accesskey="u" href="Thread-Local.html#Thread-Local">Thread-Local</a>

<hr><br>

</div>



<h4 class="subsection">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>



     </p><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> 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>



     </p><li><cite>6.4.1  Keywords</cite>



     <p>Add <code>__thread</code>.



     </p><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>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -