12template <
typename CounterType>
16template <
typename CounterType>
19 static_assert(std::is_unsigned_v<CounterType>);
23 inline explicit operator bool()
const {
return !(Value & 1); }
59template <
typename CounterType>
62 static_assert(std::is_unsigned_v<CounterType>);
81#if PLATFORM_CPU_X86_FAMILY
86 Token.Value = Count.load(std::memory_order_relaxed) &
~CounterType(1);
87 Count.fetch_or(1, std::memory_order_acq_rel);
89 Token.Value = Count.fetch_or(1, std::memory_order_acq_rel) &
~CounterType(1);
101 if ((Count.load(std::memory_order_acquire) & ~
CounterType(1)) == Compare.Value)
103 ParkingLot::Wait(&Count, [
this, Compare] {
return (Count.load(std::memory_order_acquire) & ~
CounterType(1)) == Compare.Value; },
nullptr);
116 if ((Count.load(std::memory_order_acquire) & ~
CounterType(1)) == Compare.Value)
135 if ((Count.load(std::memory_order_acquire) & ~
CounterType(1)) == Compare.Value)
166 if ((
Value & 1) && Count.compare_exchange_strong(
Value,
Value + 1, std::memory_order_release))
168 ParkingLot::WakeAll(&Count);
184#if PLATFORM_WEAKLY_CONSISTENT_MEMORY
204 if ((
Value & 1) && Count.compare_exchange_strong(
Value,
Value + 1, std::memory_order_release))
206 ParkingLot::WakeAll(&Count);
211 std::atomic<CounterType> Count = 0;
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
Definition EventCount.h:18
Definition EventCount.h:61
TEventCountToken< CounterType > PrepareWait()
Definition EventCount.h:77
void Wait(TEventCountToken< CounterType > Compare)
Definition EventCount.h:99
TEventCount(const TEventCount &)=delete
bool WaitFor(TEventCountToken< CounterType > Compare, FMonotonicTimeSpan WaitTime)
Definition EventCount.h:114
constexpr TEventCount()=default
TEventCount & operator=(const TEventCount &)=delete
bool WaitUntil(TEventCountToken< CounterType > Compare, FMonotonicTimePoint WaitTime)
Definition EventCount.h:133
void NotifyWeak()
Definition EventCount.h:180
void Notify()
Definition EventCount.h:151
FWaitState Wait(const void *Address, TFunctionWithContext< bool()> CanWait, TFunctionWithContext< void()> BeforeWait)
Definition ParkingLot.h:52
FWaitState WaitFor(const void *Address, TFunctionWithContext< bool()> CanWait, TFunctionWithContext< void()> BeforeWait, FMonotonicTimeSpan WaitTime)
Definition ParkingLot.h:65
FWaitState WaitUntil(const void *Address, TFunctionWithContext< bool()> CanWait, TFunctionWithContext< void()> BeforeWait, FMonotonicTimePoint WaitTime)
Definition ParkingLot.h:78
Definition AdvancedWidgetsModule.cpp:13
Definition MonotonicTime.h:74
Definition MonotonicTime.h:20
Definition ParkingLot.h:20
bool bDidWake
Definition ParkingLot.h:24