blob: 7d7602523dc34912f492f4b5ae0f6548061aef6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<h1 id="firstHeading" class="firstHeading">thread_local</h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code><threads.h></code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c11 t-until-c23"> <td> <pre data-language="c">#define thread_local _Thread_local</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c11">(since C11)</span> <br><span class="t-mark-rev t-until-c23">(removed in C23)</span> </td> </tr> </table> <p>Convenience macro which can be used to specify that an object has <a href="../language/storage_duration" title="c/language/storage duration">thread-local storage duration</a>.</p>
<h3 id="Notes"> Notes</h3> <p>Since C23, <code>thread_local</code> is itself a keyword, which may also be a predefined macro, so <code><threads.h></code> no longer provides it.</p>
<h3 id="References"> References</h3> <ul>
<li> C17 standard (ISO/IEC 9899:2018): </li>
<ul><li> 7.26.1/3 thread_local (p: 274) </li></ul>
<li> C11 standard (ISO/IEC 9899:2011): </li>
<ul><li> 7.26.1/3 thread_local (p: 376) </li></ul>
</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/keyword/thread_local" title="cpp/keyword/thread local">C++ documentation</a></span> for <code>thread_local</code> </td>
</tr> </table> <div class="_attribution">
<p class="_attribution-p">
© cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
<a href="https://en.cppreference.com/w/c/thread/thread_local" class="_attribution-link">https://en.cppreference.com/w/c/thread/thread_local</a>
</p>
</div>
|