]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/asio/detail/gcc_hppa_fenced_block.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / asio / detail / gcc_hppa_fenced_block.hpp
CommitLineData
7c673cae
FG
1//
2// detail/gcc_hppa_fenced_block.hpp
3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4//
92f5a8d4 5// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7c673cae
FG
6//
7// Distributed under the Boost Software License, Version 1.0. (See accompanying
8// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9//
10
11#ifndef BOOST_ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
12#define BOOST_ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/config.hpp>
19
20#if defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
21
b32b8144
FG
22#include <boost/asio/detail/noncopyable.hpp>
23
7c673cae
FG
24#include <boost/asio/detail/push_options.hpp>
25
26namespace boost {
27namespace asio {
28namespace detail {
29
30class gcc_hppa_fenced_block
31 : private noncopyable
32{
33public:
34 enum half_t { half };
35 enum full_t { full };
36
37 // Constructor for a half fenced block.
38 explicit gcc_hppa_fenced_block(half_t)
39 {
40 }
41
42 // Constructor for a full fenced block.
43 explicit gcc_hppa_fenced_block(full_t)
44 {
45 barrier();
46 }
47
48 // Destructor.
49 ~gcc_hppa_fenced_block()
50 {
51 barrier();
52 }
53
54private:
55 static void barrier()
56 {
57 // This is just a placeholder and almost certainly not sufficient.
58 __asm__ __volatile__ ("" : : : "memory");
59 }
60};
61
62} // namespace detail
63} // namespace asio
64} // namespace boost
65
66#include <boost/asio/detail/pop_options.hpp>
67
68#endif // defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
69
70#endif // BOOST_ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP