blob: ad4bd120be9d53cbf3e666e677c6917b9762a3d1 (
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
|
<h1 id="firstHeading" class="firstHeading">ATOMIC_*_LOCK_FREE</h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code><stdatomic.h></code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c11"> <td> <pre data-language="c">#define ATOMIC_BOOL_LOCK_FREE /* implementation-defined */
#define ATOMIC_CHAR_LOCK_FREE /* implementation-defined */
#define ATOMIC_CHAR16_T_LOCK_FREE /* implementation-defined */
#define ATOMIC_CHAR32_T_LOCK_FREE /* implementation-defined */
#define ATOMIC_WCHAR_T_LOCK_FREE /* implementation-defined */
#define ATOMIC_SHORT_LOCK_FREE /* implementation-defined */
#define ATOMIC_INT_LOCK_FREE /* implementation-defined */
#define ATOMIC_LONG_LOCK_FREE /* implementation-defined */
#define ATOMIC_LLONG_LOCK_FREE /* implementation-defined */
#define ATOMIC_POINTER_LOCK_FREE /* implementation-defined */</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c11">(since C11)</span> </td> </tr> <tr class="t-dcl t-since-c23"> <td> <pre data-language="c">#define ATOMIC_CHAR8_T_LOCK_FREE /* implementation-defined */</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c23">(since C23)</span> </td> </tr> </table> <p>Expands to <a href="../language/constant_expression" title="c/language/constant expression">preprocessor constant expressions</a> that evaluate to either <code>0</code>, <code>1</code>, or <code>2</code> which indicate the lock-free property of the corresponding <a href="../thread#Atomic_operations" title="c/thread">atomic types</a> (both signed and unsigned).</p>
<table class="t-dsc-begin"> <tr class="t-dsc-hitem"> <th> Value </th> <th> Explanation </th>
</tr> <tr class="t-dsc"> <td> <code>0</code> </td> <td> The atomic type is never lock-free </td>
</tr> <tr class="t-dsc"> <td> <code>1</code> </td> <td> The atomic type is sometimes lock-free </td>
</tr> <tr class="t-dsc"> <td> <code>2</code> </td> <td> The atomic type is always lock-free </td>
</tr> </table> <h3 id="References"> References</h3> <ul>
<li> C17 standard (ISO/IEC 9899:2018): </li>
<ul><li> 7.17.1/3 atomic lock-free macros (p: 200) </li></ul>
<li> C11 standard (ISO/IEC 9899:2011): </li>
<ul><li> 7.17.1/3 atomic lock-free macros (p: 273) </li></ul>
</ul> <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/atomic/ATOMIC_LOCK_FREE_consts" class="_attribution-link">https://en.cppreference.com/w/c/atomic/ATOMIC_LOCK_FREE_consts</a>
</p>
</div>
|