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
posix_mutex.hpp
Go to the documentation of this file.
1
//
2
// detail/posix_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_POSIX_MUTEX_HPP
12
#define ASIO_DETAIL_POSIX_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_PTHREADS)
21
22
#include <pthread.h>
23
#include "
asio/detail/noncopyable.hpp
"
24
#include "
asio/detail/scoped_lock.hpp
"
25
26
#include "
asio/detail/push_options.hpp
"
27
28
namespace
asio
{
29
namespace
detail {
30
31
class
posix_event;
32
33
class
posix_mutex
34
:
private
noncopyable
35
{
36
public
:
37
typedef
asio::detail::scoped_lock<posix_mutex>
scoped_lock;
38
39
// Constructor.
40
ASIO_DECL
posix_mutex();
41
42
// Destructor.
43
~posix_mutex()
44
{
45
::pthread_mutex_destroy(&mutex_);
// Ignore EBUSY.
46
}
47
48
// Lock the mutex.
49
void
lock()
50
{
51
(void)::pthread_mutex_lock(&mutex_);
// Ignore EINVAL.
52
}
53
54
// Unlock the mutex.
55
void
unlock()
56
{
57
(void)::pthread_mutex_unlock(&mutex_);
// Ignore EINVAL.
58
}
59
60
private
:
61
friend
class
posix_event;
62
::pthread_mutex_t mutex_;
63
};
64
65
}
// namespace detail
66
}
// namespace asio
67
68
#include "
asio/detail/pop_options.hpp
"
69
70
#if defined(ASIO_HEADER_ONLY)
71
# include "
asio/detail/impl/posix_mutex.ipp
"
72
#endif // defined(ASIO_HEADER_ONLY)
73
74
#endif // defined(ASIO_HAS_PTHREADS)
75
76
#endif // ASIO_DETAIL_POSIX_MUTEX_HPP
asio::detail::scoped_lock
Definition:
scoped_lock.hpp:27
config.hpp
push_options.hpp
scoped_lock.hpp
pop_options.hpp
posix_mutex.ipp
noncopyable.hpp
ASIO_DECL
#define ASIO_DECL
Definition:
config.hpp:43
asio
Definition:
async_result.hpp:23
Generated by
1.8.11