IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
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
8namespace ice
9{
10
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
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
void wait() noexcept
void reset(ice::u8 num_awaited) noexcept
void set() noexcept
ManualResetBarrier(ice::u8 num_awaited=0) noexcept
bool is_set() const noexcept
auto value() const noexcept -> ice::u8
void set() noexcept
void wait() noexcept
bool is_set() const noexcept
ManualResetEvent(bool set_on_create=false) noexcept
void reset() noexcept
SPDX-License-Identifier: MIT.
Definition array.hxx:12
std::uint8_t u8
Definition types.hxx:24