summaryrefslogtreecommitdiff
path: root/devdocs/c/atomic%2Fatomic_flag_init.html
blob: dbe9fef12e6a7a8620067dce7cf9864cb48b96e8 (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
    <h1 id="firstHeading" class="firstHeading">ATOMIC_FLAG_INIT</h1>            <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code>&lt;stdatomic.h&gt;</code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c11"> <td> <pre data-language="c">#define ATOMIC_FLAG_INIT /* unspecified */</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c11">(since C11)</span> </td> </tr>  </table> <p>Expands to an initializer that can be used to initialize <code><a href="atomic_flag" title="c/atomic/atomic flag">atomic_flag</a></code> type to the clear state. The value <code>atomic_flag</code> that is not initialized using this macro is indeterminate.</p>
<h3 id="Example"> Example</h3> <div class="c source-c"><pre data-language="c">#include &lt;stdatomic.h&gt;
 
atomic_flag flag = ATOMIC_FLAG_INIT;</pre></div> <h3 id="References"> References</h3>  <ul>
<li> C17 standard (ISO/IEC 9899:2018): </li>
<ul>
<li> 7.17.1/3 ATOMIC_FLAG_INIT (p: 200) </li>
<li> 7.17.8/4 ATOMIC_FLAG_INIT (p: 208) </li>
</ul>
<li> C11 standard (ISO/IEC 9899:2011): </li>
<ul>
<li> 7.17.1/3 ATOMIC_FLAG_INIT (p: 273) </li>
<li> 7.17.8/4 ATOMIC_FLAG_INIT (p: 285) </li>
</ul>
</ul>         <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="atomic_var_init" title="c/atomic/ATOMIC VAR INIT"> <span class="t-lines"><span>ATOMIC_VAR_INIT</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c11">(C11)</span><span class="t-mark-rev t-deprecated-c17">(deprecated in C17)</span><span class="t-mark-rev t-until-c23">(removed in C23)</span></span></span></div> </td> <td> initializes a new atomic object <br> <span class="t-mark">(function macro)</span>  </td>
</tr> <tr class="t-dsc"> <td> <div><a href="atomic_flag" title="c/atomic/atomic flag"> <span class="t-lines"><span>atomic_flag</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c11">(C11)</span></span></span></div> </td> <td> lock-free atomic boolean flag <br><span class="t-mark">(struct)</span> </td>
</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/atomic/ATOMIC_FLAG_INIT" title="cpp/atomic/ATOMIC FLAG INIT">C++ documentation</a></span> for <code>ATOMIC_FLAG_INIT</code> </td>
</tr> </table>           <div class="_attribution">
  <p class="_attribution-p">
    &copy; cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
    <a href="https://en.cppreference.com/w/c/atomic/ATOMIC_FLAG_INIT" class="_attribution-link">https://en.cppreference.com/w/c/atomic/ATOMIC_FLAG_INIT</a>
  </p>
</div>