Realistic 3D camera system
3D camera system components
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
asio-1.10.6
include
asio
detail
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
22
#include "
asio/detail/scoped_lock.hpp
"
23
24
#include "
asio/detail/push_options.hpp
"
25
26
namespace
asio
{
27
namespace
detail {
28
29
struct
win_static_mutex
30
{
31
typedef
asio::detail::scoped_lock<win_static_mutex>
scoped_lock;
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
66
#include "
asio/detail/pop_options.hpp
"
67
68
#if defined(ASIO_HEADER_ONLY)
69
# include "
asio/detail/impl/win_static_mutex.ipp
"
70
#endif // defined(ASIO_HEADER_ONLY)
71
72
#endif // defined(ASIO_WINDOWS)
73
74
#endif // ASIO_DETAIL_WIN_STATIC_MUTEX_HPP
asio::detail::scoped_lock
Definition:
scoped_lock.hpp:27
asio::init
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))
config.hpp
push_options.hpp
scoped_lock.hpp
pop_options.hpp
ASIO_DECL
#define ASIO_DECL
Definition:
config.hpp:43
win_static_mutex.ipp
asio
Definition:
async_result.hpp:23
Generated by
1.8.11