PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/asio/detail/gcc_hppa_fenced_block.hpp

http://hadesmem.googlecode.com/
C++ Header | 60 lines | 35 code | 13 blank | 12 comment | 3 complexity | 01e7fca7eb9e677725b7b020b9a3802e MD5 | raw file
 1//
 2// detail/gcc_hppa_fenced_block.hpp
 3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4//
 5// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 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
22#include <boost/asio/detail/push_options.hpp>
23
24namespace boost {
25namespace asio {
26namespace detail {
27
28class gcc_hppa_fenced_block
29  : private noncopyable
30{
31public:
32  // Constructor.
33  gcc_hppa_fenced_block()
34  {
35    barrier();
36  }
37
38  // Destructor.
39  ~gcc_hppa_fenced_block()
40  {
41    barrier();
42  }
43
44private:
45  static void barrier()
46  {
47    // This is just a placeholder and almost certainly not sufficient.
48    __asm__ __volatile__ ("" : : : "memory");
49  }
50};
51
52} // namespace detail
53} // namespace asio
54} // namespace boost
55
56#include <boost/asio/detail/pop_options.hpp>
57
58#endif // defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
59
60#endif // BOOST_ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP