xref: /freebsd/contrib/llvm-project/libcxx/include/__atomic/fence.h (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1*06c3fb27SDimitry Andric //===----------------------------------------------------------------------===//
2*06c3fb27SDimitry Andric //
3*06c3fb27SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*06c3fb27SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*06c3fb27SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*06c3fb27SDimitry Andric //
7*06c3fb27SDimitry Andric //===----------------------------------------------------------------------===//
8*06c3fb27SDimitry Andric 
9*06c3fb27SDimitry Andric #ifndef _LIBCPP___ATOMIC_FENCE_H
10*06c3fb27SDimitry Andric #define _LIBCPP___ATOMIC_FENCE_H
11*06c3fb27SDimitry Andric 
12*06c3fb27SDimitry Andric #include <__atomic/cxx_atomic_impl.h>
13*06c3fb27SDimitry Andric #include <__atomic/memory_order.h>
14*06c3fb27SDimitry Andric #include <__config>
15*06c3fb27SDimitry Andric 
16*06c3fb27SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17*06c3fb27SDimitry Andric #  pragma GCC system_header
18*06c3fb27SDimitry Andric #endif
19*06c3fb27SDimitry Andric 
20*06c3fb27SDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
21*06c3fb27SDimitry Andric 
22*06c3fb27SDimitry Andric inline _LIBCPP_HIDE_FROM_ABI
23*06c3fb27SDimitry Andric void
24*06c3fb27SDimitry Andric atomic_thread_fence(memory_order __m) _NOEXCEPT
25*06c3fb27SDimitry Andric {
26*06c3fb27SDimitry Andric     __cxx_atomic_thread_fence(__m);
27*06c3fb27SDimitry Andric }
28*06c3fb27SDimitry Andric 
29*06c3fb27SDimitry Andric inline _LIBCPP_HIDE_FROM_ABI
30*06c3fb27SDimitry Andric void
31*06c3fb27SDimitry Andric atomic_signal_fence(memory_order __m) _NOEXCEPT
32*06c3fb27SDimitry Andric {
33*06c3fb27SDimitry Andric     __cxx_atomic_signal_fence(__m);
34*06c3fb27SDimitry Andric }
35*06c3fb27SDimitry Andric 
36*06c3fb27SDimitry Andric _LIBCPP_END_NAMESPACE_STD
37*06c3fb27SDimitry Andric 
38*06c3fb27SDimitry Andric #endif // _LIBCPP___ATOMIC_FENCE_H
39