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_mutex.hpp
Go to the documentation of this file.
1
//
2
// detail/win_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_MUTEX_HPP
12
#define ASIO_DETAIL_WIN_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/noncopyable.hpp
"
23
#include "
asio/detail/scoped_lock.hpp
"
24
#include "
asio/detail/socket_types.hpp
"
25
26
#include "
asio/detail/push_options.hpp
"
27
28
namespace
asio
{
29
namespace
detail {
30
31
class
win_mutex
32
:
private
noncopyable
33
{
34
public
:
35
typedef
asio::detail::scoped_lock<win_mutex>
scoped_lock;
36
37
// Constructor.
38
ASIO_DECL
win_mutex();
39
40
// Destructor.
41
~win_mutex()
42
{
43
::DeleteCriticalSection(&crit_section_);
44
}
45
46
// Lock the mutex.
47
void
lock()
48
{
49
::EnterCriticalSection(&crit_section_);
50
}
51
52
// Unlock the mutex.
53
void
unlock()
54
{
55
::LeaveCriticalSection(&crit_section_);
56
}
57
58
private
:
59
// Initialisation must be performed in a separate function to the constructor
60
// since the compiler does not support the use of structured exceptions and
61
// C++ exceptions in the same function.
62
ASIO_DECL
int
do_init();
63
64
::CRITICAL_SECTION crit_section_;
65
};
66
67
}
// namespace detail
68
}
// namespace asio
69
70
#include "
asio/detail/pop_options.hpp
"
71
72
#if defined(ASIO_HEADER_ONLY)
73
# include "
asio/detail/impl/win_mutex.ipp
"
74
#endif // defined(ASIO_HEADER_ONLY)
75
76
#endif // defined(ASIO_WINDOWS)
77
78
#endif // ASIO_DETAIL_WIN_MUTEX_HPP
asio::detail::scoped_lock
Definition:
scoped_lock.hpp:27
config.hpp
win_mutex.ipp
push_options.hpp
scoped_lock.hpp
pop_options.hpp
noncopyable.hpp
ASIO_DECL
#define ASIO_DECL
Definition:
config.hpp:43
socket_types.hpp
asio
Definition:
async_result.hpp:23
Generated by
1.8.11