Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / asio / detail / macos_fenced_block.hpp @ 2486

History | View | Annotate | Download (1.3 kB)

1
//
2
// detail/macos_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 BOOST_ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP
12
#define BOOST_ASIO_DETAIL_MACOS_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(__MACH__) && defined(__APPLE__)
21

    
22
#include <libkern/OSAtomic.h>
23

    
24
#include <boost/asio/detail/push_options.hpp>
25

    
26
namespace boost {
27
namespace asio {
28
namespace detail {
29

    
30
class macos_fenced_block
31
  : private noncopyable
32
{
33
public:
34
  enum half_t { half };
35
  enum full_t { full };
36

    
37
  // Constructor for a half fenced block.
38
  explicit macos_fenced_block(half_t)
39
  {
40
  }
41

    
42
  // Constructor for a full fenced block.
43
  explicit macos_fenced_block(full_t)
44
  {
45
    OSMemoryBarrier();
46
  }
47

    
48
  // Destructor.
49
  ~macos_fenced_block()
50
  {
51
    OSMemoryBarrier();
52
  }
53
};
54

    
55
} // namespace detail
56
} // namespace asio
57
} // namespace boost
58

    
59
#include <boost/asio/detail/pop_options.hpp>
60

    
61
#endif // defined(__MACH__) && defined(__APPLE__)
62

    
63
#endif // BOOST_ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP