FThreadHeartBeat

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

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FRunnable

FThreadHeartBeat

References

Module

Core

Header

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

Include

#include "HAL/ThreadHeartBeat.h"

Syntax

class FThreadHeartBeat : public FRunnable

Remarks

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

Constructors

No constructors are accessible with public or protected access.

Destructors

No destructors are accessible with public or protected access.

Functions

Name Description

Public function

uint32

 

CheckCheckpointHeartBeat

(
    double& OutHangDuration
)

Called by a supervising thread to check all checkpoints forward progress

Public function

uint32

 

CheckFunctionHeartBeat

(
    double& OutHangDuration
)

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

Public function

uint32

 

CheckHeartBeat

(
    double& OutHangDuration
)

Called by a supervising thread to check the threads' health

Public function Static

FThreadHeart...

 

Get()

Gets the heartbeat singleton

Public function Const

double

 

GetHangDuration()

Get hang duration threshold.

Public function Const

uint32

 

GetLastHungThreadId()

Get the Id of the last thread to trigger the hang detector.

Public function Const

uint32

 

GetLastStuckThreadId()

Get the Id of the last thread to pass the stuck thread time.

Public function Static

FThreadHeart...

 

GetNoInit()

Gets the heartbeat singleton

Public function

FOnThreadStu...

 

GetOnThreadStuck()

Get delegate for callback on stuck or unstuck thread.

Public function

FOnThreadUns...

 

GetOnThreadUnstuck()

Public function

void

 

HeartBeat

(
    bool bReadConfig
)

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

Public function

bool

 

IsBeating()

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

Public function

void

 

KillHeartBeat()

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

Public function

void

 

MonitorCheckpointEnd

(
    FName CheckPoint
)

Called from a thread when a checkpoint has ended

Public function

void

 

MonitorCheckpointStart

(
    FName EndCheckPoint,
    double TimeToReachCheckpoint
)

Called from a thread to register a checkpoint to be monitored

Public function

void

 

MonitorFunctionEnd()

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

Public function

void

 

MonitorFunctionStart()

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

Public function

void

 

PresentFrame()

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

Public function

void

 

ResumeHeartBeat

(
    bool bAllThreads
)

Resume heartbeat measuring for the current thread

Public function

void

 

SetDurationMultiplier

(
    double NewMultiplier
)

Sets a multiplier to the hang duration (>= 1.0).

Public function

void

 

Start()

Begin measuring heartbeat

Public function

void

 

SuspendHeartBeat

(
    bool bAllThreads
)

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

Overridden from FRunnable

Name Description

Public function Virtual

bool

 

Init()

Initializes the runnable object.

Public function Virtual

uint32

 

Run()

Runs the runnable object.

Public function Virtual

void

 

Stop()

Stops the runnable object.

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

Enums

Name

Description

Public enum

EConstants

Constants

Name

Description

Singleton