YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
atomic_event.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
yaclib/fwd.hpp
>
4
#include <
yaclib/util/ref.hpp
>
5
6
#include <yaclib_std/atomic>
7
8
namespace
yaclib::detail
{
9
10
class
AtomicEvent
{
11
public
:
12
using
Token
=
Unit
;
13
14
static
Token
Make
()
noexcept
;
15
16
void
Wait
(
Token
)
noexcept
;
17
18
void
Set
()
noexcept
;
19
20
void
Reset
()
noexcept
;
21
22
#if !defined(_LIBCPP_VERSION) || defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
23
using
wait_t
= std::int32_t;
24
#else
25
using
wait_t
= std::int64_t;
26
#endif
27
private
:
28
yaclib_std::atomic<wait_t> _state = 0;
29
};
30
31
}
// namespace yaclib::detail
yaclib::detail::AtomicEvent
Definition
atomic_event.hpp:10
yaclib::detail::AtomicEvent::wait_t
std::int32_t wait_t
Definition
atomic_event.hpp:23
yaclib::detail::AtomicEvent::Set
void Set() noexcept
Definition
atomic_event.cpp:19
yaclib::detail::AtomicEvent::Make
static Token Make() noexcept
Definition
atomic_event.cpp:5
yaclib::detail::AtomicEvent::Reset
void Reset() noexcept
Definition
atomic_event.cpp:30
yaclib::detail::AtomicEvent::Token
Unit Token
Definition
atomic_event.hpp:12
yaclib::detail::AtomicEvent::Wait
void Wait(Token) noexcept
Definition
atomic_event.cpp:9
fwd.hpp
yaclib::detail
Definition
base_core.hpp:18
yaclib::MakeContract
Contract< V, E > MakeContract()
Creates related future and promise.
Definition
contract.hpp:25
ref.hpp
include
yaclib
util
detail
atomic_event.hpp
Generated by
1.9.8