]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/atomic/detail/ops_gcc_atomic.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / atomic / detail / ops_gcc_atomic.hpp
1 /*
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
5 *
6 * Copyright (c) 2014 Andrey Semashev
7 */
8 /*!
9 * \file atomic/detail/ops_gcc_atomic.hpp
10 *
11 * This header contains implementation of the \c operations template.
12 */
13
14 #ifndef BOOST_ATOMIC_DETAIL_OPS_GCC_ATOMIC_HPP_INCLUDED_
15 #define BOOST_ATOMIC_DETAIL_OPS_GCC_ATOMIC_HPP_INCLUDED_
16
17 #include <cstddef>
18 #include <boost/memory_order.hpp>
19 #include <boost/atomic/detail/config.hpp>
20 #include <boost/atomic/detail/storage_type.hpp>
21 #include <boost/atomic/detail/operations_fwd.hpp>
22 #include <boost/atomic/capabilities.hpp>
23 #if (defined(__clang__) || (defined(BOOST_GCC) && (BOOST_GCC+0) >= 70000)) && (defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B) || defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B))
24 #include <boost/atomic/detail/ops_gcc_x86_dcas.hpp>
25 #include <boost/atomic/detail/ops_cas_based.hpp>
26 #endif
27
28 #if __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE || __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE ||\
29 __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE || __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE ||\
30 __GCC_ATOMIC_CHAR_LOCK_FREE != BOOST_ATOMIC_CHAR_LOCK_FREE || __GCC_ATOMIC_BOOL_LOCK_FREE != BOOST_ATOMIC_BOOL_LOCK_FREE ||\
31 __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE
32 // There are platforms where we need to use larger storage types
33 #include <boost/atomic/detail/int_sizes.hpp>
34 #include <boost/atomic/detail/ops_extending_cas_based.hpp>
35 #endif
36
37 #ifdef BOOST_HAS_PRAGMA_ONCE
38 #pragma once
39 #endif
40
41 #if defined(__INTEL_COMPILER)
42 // This is used to suppress warning #32013 described below for Intel Compiler.
43 // In debug builds the compiler does not inline any functions, so basically
44 // every atomic function call results in this warning. I don't know any other
45 // way to selectively disable just this one warning.
46 #pragma system_header
47 #endif
48
49 namespace boost {
50 namespace atomics {
51 namespace detail {
52
53 /*!
54 * The function converts \c boost::memory_order values to the compiler-specific constants.
55 *
56 * NOTE: The intention is that the function is optimized away by the compiler, and the
57 * compiler-specific constants are passed to the intrinsics. I know constexpr doesn't
58 * work in this case because the standard atomics interface require memory ordering
59 * constants to be passed as function arguments, at which point they stop being constexpr.
60 * However it is crucial that the compiler sees constants and not runtime values,
61 * because otherwise it just ignores the ordering value and always uses seq_cst.
62 * This is the case with Intel C++ Compiler 14.0.3 (Composer XE 2013 SP1, update 3) and
63 * gcc 4.8.2. Intel Compiler issues a warning in this case:
64 *
65 * warning #32013: Invalid memory order specified. Defaulting to seq_cst memory order.
66 *
67 * while gcc acts silently.
68 *
69 * To mitigate the problem ALL functions, including the atomic<> members must be
70 * declared with BOOST_FORCEINLINE. In this case the compilers are able to see that
71 * all functions are called with constant orderings and call intrinstcts properly.
72 *
73 * Unfortunately, this still doesn't work in debug mode as the compiler doesn't
74 * inline functions even when marked with BOOST_FORCEINLINE. In this case all atomic
75 * operaions will be executed with seq_cst semantics.
76 */
77 BOOST_FORCEINLINE BOOST_CONSTEXPR int convert_memory_order_to_gcc(memory_order order) BOOST_NOEXCEPT
78 {
79 return (order == memory_order_relaxed ? __ATOMIC_RELAXED : (order == memory_order_consume ? __ATOMIC_CONSUME :
80 (order == memory_order_acquire ? __ATOMIC_ACQUIRE : (order == memory_order_release ? __ATOMIC_RELEASE :
81 (order == memory_order_acq_rel ? __ATOMIC_ACQ_REL : __ATOMIC_SEQ_CST)))));
82 }
83
84 template< typename T >
85 struct gcc_atomic_operations
86 {
87 typedef T storage_type;
88
89 // Note: In the current implementation, gcc_atomic_operations are used onlu when the particularly sized __atomic
90 // intrinsics are always lock-free (i.e. the corresponding LOCK_FREE macro is 2). Therefore it is safe to
91 // always set is_always_lock_free to true here.
92 static BOOST_CONSTEXPR_OR_CONST bool is_always_lock_free = true;
93
94 static BOOST_FORCEINLINE void store(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
95 {
96 __atomic_store_n(&storage, v, atomics::detail::convert_memory_order_to_gcc(order));
97 }
98
99 static BOOST_FORCEINLINE storage_type load(storage_type const volatile& storage, memory_order order) BOOST_NOEXCEPT
100 {
101 return __atomic_load_n(&storage, atomics::detail::convert_memory_order_to_gcc(order));
102 }
103
104 static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
105 {
106 return __atomic_fetch_add(&storage, v, atomics::detail::convert_memory_order_to_gcc(order));
107 }
108
109 static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
110 {
111 return __atomic_fetch_sub(&storage, v, atomics::detail::convert_memory_order_to_gcc(order));
112 }
113
114 static BOOST_FORCEINLINE storage_type exchange(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
115 {
116 return __atomic_exchange_n(&storage, v, atomics::detail::convert_memory_order_to_gcc(order));
117 }
118
119 static BOOST_FORCEINLINE bool compare_exchange_strong(
120 storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order success_order, memory_order failure_order) BOOST_NOEXCEPT
121 {
122 return __atomic_compare_exchange_n
123 (
124 &storage, &expected, desired, false,
125 atomics::detail::convert_memory_order_to_gcc(success_order),
126 atomics::detail::convert_memory_order_to_gcc(failure_order)
127 );
128 }
129
130 static BOOST_FORCEINLINE bool compare_exchange_weak(
131 storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order success_order, memory_order failure_order) BOOST_NOEXCEPT
132 {
133 return __atomic_compare_exchange_n
134 (
135 &storage, &expected, desired, true,
136 atomics::detail::convert_memory_order_to_gcc(success_order),
137 atomics::detail::convert_memory_order_to_gcc(failure_order)
138 );
139 }
140
141 static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
142 {
143 return __atomic_fetch_and(&storage, v, atomics::detail::convert_memory_order_to_gcc(order));
144 }
145
146 static BOOST_FORCEINLINE storage_type fetch_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
147 {
148 return __atomic_fetch_or(&storage, v, atomics::detail::convert_memory_order_to_gcc(order));
149 }
150
151 static BOOST_FORCEINLINE storage_type fetch_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
152 {
153 return __atomic_fetch_xor(&storage, v, atomics::detail::convert_memory_order_to_gcc(order));
154 }
155
156 static BOOST_FORCEINLINE bool test_and_set(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
157 {
158 return __atomic_test_and_set(&storage, atomics::detail::convert_memory_order_to_gcc(order));
159 }
160
161 static BOOST_FORCEINLINE void clear(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
162 {
163 __atomic_clear(const_cast< storage_type* >(&storage), atomics::detail::convert_memory_order_to_gcc(order));
164 }
165 };
166
167 #if BOOST_ATOMIC_INT128_LOCK_FREE > 0
168 #if (defined(__clang__) || (defined(BOOST_GCC) && (BOOST_GCC+0) >= 70000)) && defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B)
169
170 // Workaround for clang bug: http://llvm.org/bugs/show_bug.cgi?id=19149
171 // Clang 3.4 does not implement 128-bit __atomic* intrinsics even though it defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
172 // A similar problem exists with gcc 7 as well, as it requires to link with libatomic to use 16-byte intrinsics:
173 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80878
174 template< bool Signed >
175 struct operations< 16u, Signed > :
176 public cas_based_operations< gcc_dcas_x86_64< Signed > >
177 {
178 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 16u;
179 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
180 };
181
182 #else
183
184 template< bool Signed >
185 struct operations< 16u, Signed > :
186 public gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >
187 {
188 typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
189
190 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 16u;
191 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
192 };
193
194 #endif
195 #endif
196
197
198 #if BOOST_ATOMIC_INT64_LOCK_FREE > 0
199 #if defined(__clang__) && defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B)
200
201 // Workaround for clang bug http://llvm.org/bugs/show_bug.cgi?id=19355
202 template< bool Signed >
203 struct operations< 8u, Signed > :
204 public cas_based_operations< gcc_dcas_x86< Signed > >
205 {
206 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u;
207 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
208 };
209
210 #elif (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 8 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
211 (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 8 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
212 (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 8 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
213 (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 8 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
214 (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 8 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE)
215
216 #define BOOST_ATOMIC_DETAIL_INT64_EXTENDED
217
218 template< bool Signed >
219 struct operations< 8u, Signed > :
220 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 8u, Signed >
221 {
222 typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
223
224 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u;
225 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
226 };
227
228 #else
229
230 template< bool Signed >
231 struct operations< 8u, Signed > :
232 public gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >
233 {
234 typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
235
236 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u;
237 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
238 };
239
240 #endif
241 #endif
242
243 #if BOOST_ATOMIC_INT32_LOCK_FREE > 0
244 #if (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 4 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
245 (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 4 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
246 (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 4 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
247 (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 4 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
248 (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 4 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE)
249
250 #define BOOST_ATOMIC_DETAIL_INT32_EXTENDED
251
252 #if !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
253
254 template< bool Signed >
255 struct operations< 4u, Signed > :
256 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >, 4u, Signed >
257 {
258 typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
259
260 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u;
261 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
262 };
263
264 #else // !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
265
266 template< bool Signed >
267 struct operations< 4u, Signed > :
268 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 4u, Signed >
269 {
270 typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
271
272 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 16u;
273 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
274 };
275
276 #endif // !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
277
278 #else
279
280 template< bool Signed >
281 struct operations< 4u, Signed > :
282 public gcc_atomic_operations< typename make_storage_type< 4u, Signed >::type >
283 {
284 typedef typename make_storage_type< 4u, Signed >::aligned aligned_storage_type;
285
286 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 4u;
287 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
288 };
289
290 #endif
291 #endif
292
293 #if BOOST_ATOMIC_INT16_LOCK_FREE > 0
294 #if (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 2 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
295 (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 2 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
296 (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 2 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
297 (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 2 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
298 (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 2 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE)
299
300 #define BOOST_ATOMIC_DETAIL_INT16_EXTENDED
301
302 #if !defined(BOOST_ATOMIC_DETAIL_INT32_EXTENDED)
303
304 template< bool Signed >
305 struct operations< 2u, Signed > :
306 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 4u, Signed >::type >, 2u, Signed >
307 {
308 typedef typename make_storage_type< 4u, Signed >::aligned aligned_storage_type;
309
310 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 4u;
311 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
312 };
313
314 #elif !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
315
316 template< bool Signed >
317 struct operations< 2u, Signed > :
318 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >, 2u, Signed >
319 {
320 typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
321
322 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u;
323 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
324 };
325
326 #else
327
328 template< bool Signed >
329 struct operations< 2u, Signed > :
330 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 2u, Signed >
331 {
332 typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
333
334 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 16u;
335 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
336 };
337
338 #endif
339
340 #else
341
342 template< bool Signed >
343 struct operations< 2u, Signed > :
344 public gcc_atomic_operations< typename make_storage_type< 2u, Signed >::type >
345 {
346 typedef typename make_storage_type< 2u, Signed >::aligned aligned_storage_type;
347
348 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 2u;
349 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
350 };
351
352 #endif
353 #endif
354
355 #if BOOST_ATOMIC_INT8_LOCK_FREE > 0
356 #if (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 1 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
357 (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 1 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
358 (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 1 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
359 (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 1 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
360 (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 1 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE) ||\
361 (__GCC_ATOMIC_CHAR_LOCK_FREE != BOOST_ATOMIC_CHAR_LOCK_FREE) ||\
362 (__GCC_ATOMIC_BOOL_LOCK_FREE != BOOST_ATOMIC_BOOL_LOCK_FREE)
363
364 #if !defined(BOOST_ATOMIC_DETAIL_INT16_EXTENDED)
365
366 template< bool Signed >
367 struct operations< 1u, Signed > :
368 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 2u, Signed >::type >, 1u, Signed >
369 {
370 typedef typename make_storage_type< 2u, Signed >::aligned aligned_storage_type;
371
372 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 2u;
373 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
374 };
375
376 #elif !defined(BOOST_ATOMIC_DETAIL_INT32_EXTENDED)
377
378 template< bool Signed >
379 struct operations< 1u, Signed > :
380 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 4u, Signed >::type >, 1u, Signed >
381 {
382 typedef typename make_storage_type< 4u, Signed >::aligned aligned_storage_type;
383
384 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 4u;
385 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
386 };
387
388 #elif !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
389
390 template< bool Signed >
391 struct operations< 1u, Signed > :
392 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >, 1u, Signed >
393 {
394 typedef typename make_storage_type< 8u, Signed >::aligned aligned_storage_type;
395
396 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u;
397 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
398 };
399
400 #else
401
402 template< bool Signed >
403 struct operations< 1u, Signed > :
404 public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 1u, Signed >
405 {
406 typedef typename make_storage_type< 16u, Signed >::aligned aligned_storage_type;
407
408 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 16u;
409 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
410 };
411
412 #endif
413
414 #else
415
416 template< bool Signed >
417 struct operations< 1u, Signed > :
418 public gcc_atomic_operations< typename make_storage_type< 1u, Signed >::type >
419 {
420 typedef typename make_storage_type< 1u, Signed >::aligned aligned_storage_type;
421
422 static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 1u;
423 static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed;
424 };
425
426 #endif
427 #endif
428
429 #undef BOOST_ATOMIC_DETAIL_INT16_EXTENDED
430 #undef BOOST_ATOMIC_DETAIL_INT32_EXTENDED
431 #undef BOOST_ATOMIC_DETAIL_INT64_EXTENDED
432
433 BOOST_FORCEINLINE void thread_fence(memory_order order) BOOST_NOEXCEPT
434 {
435 __atomic_thread_fence(atomics::detail::convert_memory_order_to_gcc(order));
436 }
437
438 BOOST_FORCEINLINE void signal_fence(memory_order order) BOOST_NOEXCEPT
439 {
440 __atomic_signal_fence(atomics::detail::convert_memory_order_to_gcc(order));
441 }
442
443 } // namespace detail
444 } // namespace atomics
445 } // namespace boost
446
447 #endif // BOOST_ATOMIC_DETAIL_OPS_GCC_ATOMIC_HPP_INCLUDED_