UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UnixPlatformManualResetEvent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7
8#include <atomic>
9
10namespace UE::HAL::Private
11{
12
15{
16public:
20
21 inline void Reset()
22 {
23 State.store(0, std::memory_order_relaxed);
24 }
25
26 inline bool Poll()
27 {
28 return !!State.load(std::memory_order_acquire);
29 }
30
31 inline void Wait()
32 {
33 if (!State.load(std::memory_order_acquire))
34 {
35 WaitSlow();
36 }
37 }
38
39 inline bool WaitFor(FMonotonicTimeSpan WaitTime)
40 {
41 return State.load(std::memory_order_acquire) || WaitForSlow(WaitTime);
42 }
43
44 inline bool WaitUntil(FMonotonicTimePoint WaitTime)
45 {
46 return State.load(std::memory_order_acquire) || WaitUntilSlow(WaitTime);
47 }
48
49 void Notify();
50
51private:
52 void WaitSlow();
53 bool WaitForSlow(FMonotonicTimeSpan WaitTime);
54 bool WaitUntilSlow(FMonotonicTimePoint WaitTime);
55
56 // 0 = Reset, 1 = Notified
57 std::atomic<uint32> State = 0;
58};
59
60} // UE::HAL::Private
Definition UnixPlatformManualResetEvent.h:15
FUnixManualResetEvent & operator=(const FUnixManualResetEvent &)=delete
void Notify()
Definition UnixPlatformManualResetEvent.cpp:94
bool Poll()
Definition UnixPlatformManualResetEvent.h:26
void Reset()
Definition UnixPlatformManualResetEvent.h:21
FUnixManualResetEvent(const FUnixManualResetEvent &)=delete
bool WaitFor(FMonotonicTimeSpan WaitTime)
Definition UnixPlatformManualResetEvent.h:39
bool WaitUntil(FMonotonicTimePoint WaitTime)
Definition UnixPlatformManualResetEvent.h:44
void Wait()
Definition UnixPlatformManualResetEvent.h:31
Definition AndroidPlatformManualResetEvent.cpp:14
Definition MonotonicTime.h:74
Definition MonotonicTime.h:20