FEvent

Interface for waitable events.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/HAL/Event.h

Include

#include "HAL/Event.h"

Syntax

class FEvent

Remarks

Interface for waitable events.

This interface has platform-specific implementations that are used to wait for another thread to signal that it is ready for the waiting thread to do some work. It can also be used for telling groups of threads to exit.

Consider using FEventRef as a safer and more convenient alternative.

Variables

Name Description

Protected variable

uint32

 

EventId

An unique id of this event.

Protected variable

TAtomic< uint32...

 

EventStartCycles

Greater than 0, if the event called wait.

Constructors

Name Description

Public function

FEvent()

Default constructor.

Destructors

Name Description

Public function Virtual

~FEvent()

Virtual destructor.

Functions

Name Description

Public function

void

 

AdvanceStats()

Advances stats associated with this event. Used to monitor wait->trigger history.

Public function

bool

 

IsManualReset()

Whether the signaled state of this event needs to be reset manually.

Public function

void

 

Reset()

Resets the event to an untriggered (waitable) state.

Protected function

void

 

ResetForStats()

Resets start cycles to 0.

Public function

void

 

Trigger()

Triggers the event so any waiting threads are activated.

Protected function

void

 

TriggerForStats()

Send to the stats a special message which encodes a trigger for the event.

Public function

bool

 

Wait()

Waits an infinite amount of time for the event to be triggered.

Public function

bool

 

Wait

(
    uint32 WaitTime,
    const bool bIgnoreThreadIdleStats
)

Waits the specified amount of time for the event to be triggered.

Public function

bool

 

Wait

(
    const FTimespan& WaitTime,
    const bool bIgnoreThreadIdleStats
)

Waits the specified amount of time for the event to be triggered.

Protected function

void

 

WaitForStats()

Sends to the stats a special messages which encodes a wait for the event.

Constants

Name

Description

EventUniqueId

Counter used to generate an unique id for the events.

Deprecated Functions

Name Description

Public function

bool

 

Create

(
    bool bIsManualReset
)

Direct creation of FEvent is discouraged for performance reasons. Please use FPlatformProcess::GetSynchEventFromPool/ReturnSynchEventToPool.