UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FThreadHeartBeat Class Reference

#include <ThreadHeartBeat.h>

+ Inheritance diagram for FThreadHeartBeat:

Public Types

enum  EConstants { InvalidThreadId = (uint32)-1 , PresentThreadId = (uint32)-2 }
 

Public Member Functions

CORE_API void Start ()
 
CORE_API void InitSettings ()
 
 UE_DEPRECATED (5.7, "HeartBeat(bool bReadConfig) is deprecated, please use HeartBeat() instead.") CORE_API void HeartBeat(bool bReadConfig)
 
CORE_API void HeartBeat ()
 
CORE_API void PresentFrame ()
 
CORE_API uint32 CheckHeartBeat (double &OutHangDuration)
 
CORE_API void KillHeartBeat ()
 
CORE_API void MonitorFunctionStart ()
 
CORE_API void MonitorFunctionEnd ()
 
CORE_API uint32 CheckFunctionHeartBeat (double &OutHangDuration)
 
CORE_API void MonitorCheckpointStart (FName EndCheckPoint, double TimeToReachCheckpoint)
 
CORE_API void MonitorCheckpointEnd (FName CheckPoint)
 
CORE_API uint32 CheckCheckpointHeartBeat (double &OutHangDuration)
 
CORE_API void SuspendHeartBeat (bool bAllThreads=false)
 
CORE_API void ResumeHeartBeat (bool bAllThreads=false)
 
CORE_API bool IsBeating ()
 
CORE_API void SetDurationMultiplier (double NewMultiplier)
 
uint32 GetLastHungThreadId () const
 
uint32 GetLastStuckThreadId () const
 
FOnThreadStuckGetOnThreadStuck ()
 
FOnThreadUnstuckGetOnThreadUnstuck ()
 
FOnHangDelegateGetOnHangDelegate ()
 
double GetHangDuration () const
 
virtual CORE_API bool Init ()
 
virtual CORE_API uint32 Run ()
 
virtual CORE_API void Stop ()
 
- Public Member Functions inherited from FRunnable
virtual void Exit ()
 
virtual class FSingleThreadRunnableGetSingleThreadInterface ()
 
virtual ~FRunnable ()
 

Static Public Member Functions

static CORE_API FThreadHeartBeatGet ()
 
static CORE_API FThreadHeartBeatGetNoInit ()
 

Detailed Description

Thread heartbeat check class. Used by crash handling code to check for hangs.

Member Enumeration Documentation

◆ EConstants

Enumerator
InvalidThreadId 

Invalid thread Id used by CheckHeartBeat

PresentThreadId 

Id used to track presented frames (supported platforms only).

Member Function Documentation

◆ CheckCheckpointHeartBeat()

uint32 FThreadHeartBeat::CheckCheckpointHeartBeat ( double OutHangDuration)

◆ CheckFunctionHeartBeat()

uint32 FThreadHeartBeat::CheckFunctionHeartBeat ( double OutHangDuration)

Called by a supervising thread to check all function calls' being monitored health

◆ CheckHeartBeat()

uint32 FThreadHeartBeat::CheckHeartBeat ( double OutHangDuration)

Called by a supervising thread to check the threads' health

◆ Get()

FThreadHeartBeat & FThreadHeartBeat::Get ( )
static

Gets the heartbeat singleton

◆ GetHangDuration()

double FThreadHeartBeat::GetHangDuration ( ) const
inline

◆ GetLastHungThreadId()

uint32 FThreadHeartBeat::GetLastHungThreadId ( ) const
inline

◆ GetLastStuckThreadId()

uint32 FThreadHeartBeat::GetLastStuckThreadId ( ) const
inline

◆ GetNoInit()

FThreadHeartBeat * FThreadHeartBeat::GetNoInit ( )
static

◆ GetOnHangDelegate()

FOnHangDelegate & FThreadHeartBeat::GetOnHangDelegate ( )
inline

◆ GetOnThreadStuck()

FOnThreadStuck & FThreadHeartBeat::GetOnThreadStuck ( )
inline

◆ GetOnThreadUnstuck()

FOnThreadUnstuck & FThreadHeartBeat::GetOnThreadUnstuck ( )
inline

◆ HeartBeat()

void FThreadHeartBeat::HeartBeat ( )

◆ Init()

bool FThreadHeartBeat::Init ( void  )
virtual

Initializes the runnable object.

This method is called in the context of the thread object that aggregates this, not the thread that passes this runnable to a new thread.

Returns
True if initialization was successful, false otherwise
See also
Run, Stop, Exit

Reimplemented from FRunnable.

◆ InitSettings()

void FThreadHeartBeat::InitSettings ( )

Update settings from command line or ini

◆ IsBeating()

bool FThreadHeartBeat::IsBeating ( )

Returns true/false if this thread is currently performing heartbeat monitoring

◆ KillHeartBeat()

void FThreadHeartBeat::KillHeartBeat ( )

Called by a thread when it's no longer expecting to be ticked

◆ MonitorCheckpointEnd()

void FThreadHeartBeat::MonitorCheckpointEnd ( FName  CheckPoint)

◆ MonitorCheckpointStart()

void FThreadHeartBeat::MonitorCheckpointStart ( FName  EndCheckPoint,
double  TimeToReachCheckpoint 
)

◆ MonitorFunctionEnd()

void FThreadHeartBeat::MonitorFunctionEnd ( )

Called by a thread when a function has completed and no longer needs to be monitored

◆ MonitorFunctionStart()

void FThreadHeartBeat::MonitorFunctionStart ( )

Called from a thread once on entry to a function to be monitored

◆ PresentFrame()

void FThreadHeartBeat::PresentFrame ( )

Called from the rendering or RHI thread when the platform RHI presents a frame (supported platforms only).

◆ ResumeHeartBeat()

void FThreadHeartBeat::ResumeHeartBeat ( bool  bAllThreads = false)

Resume heartbeat measuring for the current thread

Parameters
bAllThreadsIf true, resumes heartbeat for all threads, not only the current one

◆ Run()

uint32 FThreadHeartBeat::Run ( )
virtual

Runs the runnable object.

This is where all per object thread work is done. This is only called if the initialization was successful.

Returns
The exit code of the runnable object
See also
Init, Stop, Exit

Implements FRunnable.

◆ SetDurationMultiplier()

void FThreadHeartBeat::SetDurationMultiplier ( double  NewMultiplier)

Sets a multiplier to the hang duration (>= 1.0). Can be used to extend the duration during loading screens etc.

◆ Start()

void FThreadHeartBeat::Start ( )

Begin measuring heartbeat

◆ Stop()

void FThreadHeartBeat::Stop ( void  )
virtual

Stops the runnable object.

This is called if a thread is requested to terminate early.

See also
Init, Run, Exit

Reimplemented from FRunnable.

◆ SuspendHeartBeat()

void FThreadHeartBeat::SuspendHeartBeat ( bool  bAllThreads = false)

Suspend heartbeat measuring for the current thread if the thread has already had a heartbeat

Parameters
bAllThreadsIf true, suspends heartbeat for all threads, not only the current one

◆ UE_DEPRECATED()

FThreadHeartBeat::UE_DEPRECATED ( 5.  7,
"HeartBeat(bool bReadConfig) is  deprecated,
please use HeartBeat() instead."   
)

Called from a thread once per frame to update the heartbeat time


The documentation for this class was generated from the following files: