Realistic 3D camera system
3D camera system components
std_mutex.hpp
Go to the documentation of this file.
1 //
2 // detail/std_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_MUTEX_HPP
12 #define ASIO_DETAIL_STD_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_mutex
34  : private noncopyable
35 {
36 public:
37  typedef asio::detail::scoped_lock<std_mutex> scoped_lock;
38 
39  // Constructor.
40  std_mutex()
41  {
42  }
43 
44  // Destructor.
45  ~std_mutex()
46  {
47  }
48 
49  // Lock the mutex.
50  void lock()
51  {
52  mutex_.lock();
53  }
54 
55  // Unlock the mutex.
56  void unlock()
57  {
58  mutex_.unlock();
59  }
60 
61 private:
62  friend class std_event;
63  std::mutex mutex_;
64 };
65 
66 } // namespace detail
67 } // namespace asio
68 
70 
71 #endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
72 
73 #endif // ASIO_DETAIL_STD_MUTEX_HPP
null_mutex mutex
Definition: mutex.hpp:36