/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. #ifndef BOOST_ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
  11. #define BOOST_ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/config.hpp>
  16. #if defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
  17. #include <boost/asio/detail/push_options.hpp>
  18. namespace boost {
  19. namespace asio {
  20. namespace detail {
  21. class gcc_hppa_fenced_block
  22. : private noncopyable
  23. {
  24. public:
  25. // Constructor.
  26. gcc_hppa_fenced_block()
  27. {
  28. barrier();
  29. }
  30. // Destructor.
  31. ~gcc_hppa_fenced_block()
  32. {
  33. barrier();
  34. }
  35. private:
  36. static void barrier()
  37. {
  38. // This is just a placeholder and almost certainly not sufficient.
  39. __asm__ __volatile__ ("" : : : "memory");
  40. }
  41. };
  42. } // namespace detail
  43. } // namespace asio
  44. } // namespace boost
  45. #include <boost/asio/detail/pop_options.hpp>
  46. #endif // defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
  47. #endif // BOOST_ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP