Realistic 3D camera system
3D camera system components
win_static_mutex.hpp
Go to the documentation of this file.
1 //
2 // detail/win_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_WIN_STATIC_MUTEX_HPP
12 #define ASIO_DETAIL_WIN_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_WINDOWS)
21 
23 
25 
26 namespace asio {
27 namespace detail {
28 
29 struct win_static_mutex
30 {
32 
33  // Initialise the mutex.
34  ASIO_DECL void init();
35 
36  // Initialisation must be performed in a separate function to the "public"
37  // init() function since the compiler does not support the use of structured
38  // exceptions and C++ exceptions in the same function.
39  ASIO_DECL int do_init();
40 
41  // Lock the mutex.
42  void lock()
43  {
44  ::EnterCriticalSection(&crit_section_);
45  }
46 
47  // Unlock the mutex.
48  void unlock()
49  {
50  ::LeaveCriticalSection(&crit_section_);
51  }
52 
53  bool initialised_;
54  ::CRITICAL_SECTION crit_section_;
55 };
56 
57 #if defined(UNDER_CE)
58 # define ASIO_WIN_STATIC_MUTEX_INIT { false, { 0, 0, 0, 0, 0 } }
59 #else // defined(UNDER_CE)
60 # define ASIO_WIN_STATIC_MUTEX_INIT { false, { 0, 0, 0, 0, 0, 0 } }
61 #endif // defined(UNDER_CE)
62 
63 } // namespace detail
64 } // namespace asio
65 
67 
68 #if defined(ASIO_HEADER_ONLY)
70 #endif // defined(ASIO_HEADER_ONLY)
71 
72 #endif // defined(ASIO_WINDOWS)
73 
74 #endif // ASIO_DETAIL_WIN_STATIC_MUTEX_HPP
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))
#define ASIO_DECL
Definition: config.hpp:43