Realistic 3D camera system
3D camera system components
gcc_hppa_fenced_block.hpp
Go to the documentation of this file.
1 //
2 // detail/gcc_hppa_fenced_block.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 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 ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
12 #define 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 "asio/detail/config.hpp"
19 
20 #if defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
21 
23 
24 namespace asio {
25 namespace detail {
26 
27 class gcc_hppa_fenced_block
28  : private noncopyable
29 {
30 public:
31  enum half_t { half };
32  enum full_t { full };
33 
34  // Constructor for a half fenced block.
35  explicit gcc_hppa_fenced_block(half_t)
36  {
37  }
38 
39  // Constructor for a full fenced block.
40  explicit gcc_hppa_fenced_block(full_t)
41  {
42  barrier();
43  }
44 
45  // Destructor.
46  ~gcc_hppa_fenced_block()
47  {
48  barrier();
49  }
50 
51 private:
52  static void barrier()
53  {
54  // This is just a placeholder and almost certainly not sufficient.
55  __asm__ __volatile__ ("" : : : "memory");
56  }
57 };
58 
59 } // namespace detail
60 } // namespace asio
61 
63 
64 #endif // defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
65 
66 #endif // ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP