IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
tasks
public
ice
sync_manual_events.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/base.hxx
>
6
#include <atomic>
7
8
namespace
ice
9
{
10
11
class
ManualResetEvent
12
{
13
public
:
14
ManualResetEvent
(
bool
set_on_create =
false
) noexcept;
15
~
ManualResetEvent
() noexcept = default;
16
17
void
set
() noexcept;
18
void
reset
() noexcept;
19
void
wait
() noexcept;
20
21
bool
is_set
() const noexcept;
22
23
private:
24
#if ISP_WINDOWS
25
std::atomic<ice::u8> _internal_value;
26
#else
27
std::atomic<ice::i32> _internal_value;
28
#endif
29
};
30
31
class
ManualResetBarrier
32
{
33
public
:
34
ManualResetBarrier
(
ice::u8
num_awaited = 0) noexcept;
35
~
ManualResetBarrier
() noexcept = default;
36
37
void
set
() noexcept;
38
void
reset
(
ice
::
u8
num_awaited) noexcept;
39
void
wait
() noexcept;
40
41
bool
is_set
() const noexcept;
42
43
auto
value
() const noexcept ->
ice
::
u8
;
44
45
private:
46
std::atomic<
ice
::
u8
> _internal_value;
47
};
48
49
}
// namespace ice
base.hxx
ice::ManualResetBarrier::wait
void wait() noexcept
ice::ManualResetBarrier::reset
void reset(ice::u8 num_awaited) noexcept
ice::ManualResetBarrier::set
void set() noexcept
ice::ManualResetBarrier::ManualResetBarrier
ManualResetBarrier(ice::u8 num_awaited=0) noexcept
ice::ManualResetBarrier::is_set
bool is_set() const noexcept
ice::ManualResetBarrier::value
auto value() const noexcept -> ice::u8
ice::ManualResetEvent::set
void set() noexcept
ice::ManualResetEvent::wait
void wait() noexcept
ice::ManualResetEvent::is_set
bool is_set() const noexcept
ice::ManualResetEvent::ManualResetEvent
ManualResetEvent(bool set_on_create=false) noexcept
ice::ManualResetEvent::reset
void reset() noexcept
ice
SPDX-License-Identifier: MIT.
Definition
array.hxx:12
ice::u8
std::uint8_t u8
Definition
types.hxx:24
Generated by
1.18.0