xref: /aosp_15_r20/external/cronet/third_party/libc++/src/modules/std/atomic.cppm (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10module;
11#include <atomic>
12
13export module std:atomic;
14export namespace std {
15
16  // [atomics.order], order and consistency
17  using std::memory_order;
18  using std::memory_order_acq_rel;
19  using std::memory_order_acquire;
20  using std::memory_order_consume;
21  using std::memory_order_relaxed;
22  using std::memory_order_release;
23  using std::memory_order_seq_cst;
24
25  using std::kill_dependency;
26} // namespace std
27
28namespace std {
29
30  // [atomics.ref.generic], class template atomic_ref
31  // [atomics.ref.pointer], partial specialization for pointers
32  // using std::atomic_ref;
33
34  // [atomics.types.generic], class template atomic
35  using std::atomic;
36
37  // [atomics.nonmembers], non-member functions
38  using std::atomic_compare_exchange_strong;
39  using std::atomic_compare_exchange_strong_explicit;
40  using std::atomic_compare_exchange_weak;
41  using std::atomic_compare_exchange_weak_explicit;
42  using std::atomic_exchange;
43  using std::atomic_exchange_explicit;
44  using std::atomic_is_lock_free;
45  using std::atomic_load;
46  using std::atomic_load_explicit;
47  using std::atomic_store;
48  using std::atomic_store_explicit;
49
50  using std::atomic_fetch_add;
51  using std::atomic_fetch_add_explicit;
52  using std::atomic_fetch_and;
53  using std::atomic_fetch_and_explicit;
54  using std::atomic_fetch_or;
55  using std::atomic_fetch_or_explicit;
56  using std::atomic_fetch_sub;
57  using std::atomic_fetch_sub_explicit;
58  using std::atomic_fetch_xor;
59  using std::atomic_fetch_xor_explicit;
60  using std::atomic_notify_all;
61  using std::atomic_notify_one;
62  using std::atomic_wait;
63  using std::atomic_wait_explicit;
64
65  // [atomics.alias], type aliases
66  using std::atomic_bool;
67  using std::atomic_char;
68  using std::atomic_char16_t;
69  using std::atomic_char32_t;
70  using std::atomic_char8_t;
71  using std::atomic_int;
72  using std::atomic_llong;
73  using std::atomic_long;
74  using std::atomic_schar;
75  using std::atomic_short;
76  using std::atomic_uchar;
77  using std::atomic_uint;
78  using std::atomic_ullong;
79  using std::atomic_ulong;
80  using std::atomic_ushort;
81#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
82  using std::atomic_wchar_t;
83#endif
84
85  using std::atomic_int16_t;
86  using std::atomic_int32_t;
87  using std::atomic_int64_t;
88  using std::atomic_int8_t;
89  using std::atomic_uint16_t;
90  using std::atomic_uint32_t;
91  using std::atomic_uint64_t;
92  using std::atomic_uint8_t;
93
94  using std::atomic_int_least16_t;
95  using std::atomic_int_least32_t;
96  using std::atomic_int_least64_t;
97  using std::atomic_int_least8_t;
98  using std::atomic_uint_least16_t;
99  using std::atomic_uint_least32_t;
100  using std::atomic_uint_least64_t;
101  using std::atomic_uint_least8_t;
102
103  using std::atomic_int_fast16_t;
104  using std::atomic_int_fast32_t;
105  using std::atomic_int_fast64_t;
106  using std::atomic_int_fast8_t;
107  using std::atomic_uint_fast16_t;
108  using std::atomic_uint_fast32_t;
109  using std::atomic_uint_fast64_t;
110  using std::atomic_uint_fast8_t;
111
112  using std::atomic_intmax_t;
113  using std::atomic_intptr_t;
114  using std::atomic_ptrdiff_t;
115  using std::atomic_size_t;
116  using std::atomic_uintmax_t;
117  using std::atomic_uintptr_t;
118
119  using std::atomic_signed_lock_free;
120  using std::atomic_unsigned_lock_free;
121
122  // [atomics.flag], flag type and operations
123  using std::atomic_flag;
124
125  using std::atomic_flag_clear;
126  using std::atomic_flag_clear_explicit;
127  using std::atomic_flag_test;
128  using std::atomic_flag_test_and_set;
129  using std::atomic_flag_test_and_set_explicit;
130  using std::atomic_flag_test_explicit;
131
132  using std::atomic_flag_notify_all;
133  using std::atomic_flag_notify_one;
134  using std::atomic_flag_wait;
135  using std::atomic_flag_wait_explicit;
136
137  // [atomics.fences], fences
138  using std::atomic_signal_fence;
139  using std::atomic_thread_fence;
140
141  // [depr.atomics.nonmembers]
142  using std::atomic_init;
143
144} // namespace std
145