YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
recursive_mutex.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
yaclib/fault/detail/fiber/queue.hpp
>
4
5
namespace
yaclib::detail::fiber
{
6
7
class
RecursiveMutex
{
8
public
:
9
RecursiveMutex
() =
default
;
10
~RecursiveMutex
()
noexcept
=
default
;
11
12
RecursiveMutex
(
const
RecursiveMutex
&) =
delete
;
13
RecursiveMutex
&
operator
=(
const
RecursiveMutex
&) =
delete
;
14
15
void
lock
();
16
bool
try_lock
()
noexcept
;
17
void
unlock
()
noexcept
;
18
19
using
native_handle_type
=
void
*;
20
21
inline
native_handle_type
native_handle
();
22
23
protected
:
24
void
LockHelper
();
25
26
FiberQueue
_queue
;
27
FiberBase
::Id
_owner_id
{0};
28
std::uint32_t
_occupied_count
{0};
29
};
30
31
}
// namespace yaclib::detail::fiber
yaclib::detail::fiber::FiberBase
Definition
fiber_base.hpp:27
yaclib::detail::fiber::FiberQueue
Definition
queue.hpp:14
yaclib::detail::fiber::RecursiveMutex
Definition
recursive_mutex.hpp:7
yaclib::detail::fiber::RecursiveMutex::LockHelper
void LockHelper()
Definition
recursive_mutex.cpp:28
yaclib::detail::fiber::RecursiveMutex::_owner_id
FiberBase::Id _owner_id
Definition
recursive_mutex.hpp:27
yaclib::detail::fiber::RecursiveMutex::RecursiveMutex
RecursiveMutex()=default
yaclib::detail::fiber::RecursiveMutex::_occupied_count
std::uint32_t _occupied_count
Definition
recursive_mutex.hpp:28
yaclib::detail::fiber::RecursiveMutex::try_lock
bool try_lock() noexcept
Definition
recursive_mutex.cpp:13
yaclib::detail::fiber::RecursiveMutex::native_handle
native_handle_type native_handle()
Definition
recursive_mutex.cpp:33
yaclib::detail::fiber::RecursiveMutex::unlock
void unlock() noexcept
Definition
recursive_mutex.cpp:21
yaclib::detail::fiber::RecursiveMutex::lock
void lock()
Definition
recursive_mutex.cpp:6
yaclib::detail::fiber::RecursiveMutex::native_handle_type
void * native_handle_type
Definition
recursive_mutex.hpp:19
yaclib::detail::fiber::RecursiveMutex::~RecursiveMutex
~RecursiveMutex() noexcept=default
yaclib::detail::fiber::RecursiveMutex::_queue
FiberQueue _queue
Definition
recursive_mutex.hpp:26
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
recursive_mutex.hpp
Generated by
1.9.8