YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
mutex.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
yaclib/fault/detail/fiber/queue.hpp
>
4
5
#include <mutex>
6
7
namespace
yaclib::detail::fiber
{
8
9
class
Mutex
{
10
public
:
11
Mutex
() =
default
;
12
~Mutex
()
noexcept
=
default
;
13
14
Mutex
(
const
Mutex
&) =
delete
;
15
Mutex
&
operator
=(
const
Mutex
&) =
delete
;
16
17
void
lock
();
18
bool
try_lock
()
noexcept
;
19
void
unlock
()
noexcept
;
20
21
using
native_handle_type
=
void
*;
22
23
inline
native_handle_type
native_handle
();
24
25
protected
:
26
FiberQueue
_queue
;
27
bool
_occupied
{
false
};
28
};
29
30
}
// namespace yaclib::detail::fiber
yaclib::detail::fiber::FiberQueue
Definition
queue.hpp:14
yaclib::detail::fiber::Mutex
Definition
mutex.hpp:9
yaclib::detail::fiber::Mutex::Mutex
Mutex()=default
yaclib::detail::fiber::Mutex::native_handle
native_handle_type native_handle()
Definition
mutex.cpp:25
yaclib::detail::fiber::Mutex::unlock
void unlock() noexcept
Definition
mutex.cpp:20
yaclib::detail::fiber::Mutex::_queue
FiberQueue _queue
Definition
mutex.hpp:26
yaclib::detail::fiber::Mutex::try_lock
bool try_lock() noexcept
Definition
mutex.cpp:12
yaclib::detail::fiber::Mutex::native_handle_type
void * native_handle_type
Definition
mutex.hpp:21
yaclib::detail::fiber::Mutex::_occupied
bool _occupied
Definition
mutex.hpp:27
yaclib::detail::fiber::Mutex::~Mutex
~Mutex() noexcept=default
yaclib::detail::fiber::Mutex::lock
void lock()
Definition
mutex.cpp:5
yaclib::detail::fiber
Definition
atomic.hpp:7
yaclib::MakeContract
Contract< V, E > MakeContract()
Creates related future and promise.
Definition
contract.hpp:25
queue.hpp
include
yaclib
fault
detail
fiber
mutex.hpp
Generated by
1.9.8