YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
atomic_wait.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <yaclib/config.hpp>
4
#include <
yaclib/fault/inject.hpp
>
5
6
namespace
yaclib::detail
{
7
8
template
<
typename
Impl,
typename
T>
9
class
AtomicWait
:
protected
Impl {
10
public
:
11
using
Impl::Impl;
12
13
#if YACLIB_FUTEX != 0
14
void
wait(T
old
, std::memory_order
order
= std::memory_order_seq_cst)
const
noexcept
{
15
YACLIB_INJECT_FAULT
(Impl::wait(
old
,
order
));
16
}
17
void
wait(T
old
, std::memory_order
order
= std::memory_order_seq_cst)
const
volatile
noexcept
{
18
YACLIB_INJECT_FAULT
(Impl::wait(
old
,
order
));
19
}
20
21
void
notify_one()
noexcept
{
22
YACLIB_INJECT_FAULT
(Impl::notify_one());
23
}
24
void
notify_one()
volatile
noexcept
{
25
YACLIB_INJECT_FAULT
(Impl::notify_one());
26
}
27
28
void
notify_all()
noexcept
{
29
YACLIB_INJECT_FAULT
(Impl::notify_all());
30
}
31
void
notify_all()
volatile
noexcept
{
32
YACLIB_INJECT_FAULT
(Impl::notify_all());
33
}
34
#endif
35
};
36
37
}
// namespace yaclib::detail
yaclib::detail::AtomicWait
Definition
atomic_wait.hpp:9
inject.hpp
YACLIB_INJECT_FAULT
#define YACLIB_INJECT_FAULT(statement)
Definition
inject.hpp:20
yaclib::detail
Definition
base_core.hpp:18
yaclib::MakeContract
Contract< V, E > MakeContract()
Creates related future and promise.
Definition
contract.hpp:25
include
yaclib
fault
detail
atomic_wait.hpp
Generated by
1.9.8