UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MicrosoftPlatformManualResetEvent.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 bWait.store(true, std::memory_order_relaxed);
24 }
25
26 inline bool Poll()
27 {
28 return !bWait.load(std::memory_order_acquire);
29 }
30
31 inline void Wait()
32 {
33 if (bWait.load(std::memory_order_acquire))
34 {
35 WaitSlow();
36 }
37 }
38
50 inline bool WaitFor(FMonotonicTimeSpan WaitTime)
51 {
52 return !bWait.load(std::memory_order_acquire) || WaitForSlow(WaitTime);
53 }
54
66 inline bool WaitUntil(FMonotonicTimePoint WaitTime)
67 {
68 return !bWait.load(std::memory_order_acquire) || WaitUntilSlow(WaitTime);
69 }
70
71 void Notify();
72
73private:
74 void WaitSlow();
75 bool WaitForSlow(FMonotonicTimeSpan WaitTime);
76 bool WaitUntilSlow(FMonotonicTimePoint WaitTime);
77
78 std::atomic<bool> bWait = true;
79};
80
81} // UE::HAL::Private
Definition MicrosoftPlatformManualResetEvent.h:15
FMicrosoftManualResetEvent(const FMicrosoftManualResetEvent &)=delete
FMicrosoftManualResetEvent & operator=(const FMicrosoftManualResetEvent &)=delete
void Notify()
Definition MicrosoftPlatformManualResetEvent.cpp:72
void Wait()
Definition MicrosoftPlatformManualResetEvent.h:31
bool WaitFor(FMonotonicTimeSpan WaitTime)
Definition MicrosoftPlatformManualResetEvent.h:50
bool WaitUntil(FMonotonicTimePoint WaitTime)
Definition MicrosoftPlatformManualResetEvent.h:66
void Reset()
Definition MicrosoftPlatformManualResetEvent.h:21
bool Poll()
Definition MicrosoftPlatformManualResetEvent.h:26
Definition AndroidPlatformManualResetEvent.cpp:14
Definition MonotonicTime.h:74
Definition MonotonicTime.h:20