Realistic 3D camera system
3D camera system components
std_static_mutex.hpp
Go to the documentation of this file.
1 //
2 // detail/std_static_mutex.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_STD_STATIC_MUTEX_HPP
12 #define ASIO_DETAIL_STD_STATIC_MUTEX_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(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
21 
22 #include <mutex>
25 
27 
28 namespace asio {
29 namespace detail {
30 
31 class std_event;
32 
33 class std_static_mutex
34  : private noncopyable
35 {
36 public:
38 
39  // Constructor.
40  std_static_mutex(int)
41  {
42  }
43 
44  // Destructor.
45  ~std_static_mutex()
46  {
47  }
48 
49  // Initialise the mutex.
50  void init()
51  {
52  // Nothing to do.
53  }
54 
55  // Lock the mutex.
56  void lock()
57  {
58  mutex_.lock();
59  }
60 
61  // Unlock the mutex.
62  void unlock()
63  {
64  mutex_.unlock();
65  }
66 
67 private:
68  friend class std_event;
69  std::mutex mutex_;
70 };
71 
72 #define ASIO_STD_STATIC_MUTEX_INIT 0
73 
74 } // namespace detail
75 } // namespace asio
76 
78 
79 #endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
80 
81 #endif // ASIO_DETAIL_STD_STATIC_MUTEX_HPP
null_mutex mutex
Definition: mutex.hpp:36
asio::basic_streambuf< Allocator > MatchCondition enable_if< is_match_condition< MatchCondition >::value >::type *detail::async_result_init< ReadHandler, void(asio::error_code, std::size_t)> init(ASIO_MOVE_CAST(ReadHandler)(handler))