Navigation
API > API/Runtime > API/Runtime/Core
Thread heartbeat check class. Used by crash handling code to check for hangs.
| Name | FThreadHeartBeat |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/HAL/ThreadHeartBeat.h |
| Include Path | #include "HAL/ThreadHeartBeat.h" |
Syntax
class FThreadHeartBeat : public FRunnable
Inheritance Hierarchy
- FRunnable → FThreadHeartBeat
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FThreadHeartBeat() |
HAL/ThreadHeartBeat.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FThreadHeartBeat() |
HAL/ThreadHeartBeat.h |
Structs
| Name | Remarks |
|---|---|
| FHeartBeatInfo | Holds per-thread info about the heartbeat |
Enums
Public
| Name | Remarks |
|---|---|
| EConstants |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Singleton | FThreadHeartBeat * | HAL/ThreadHeartBeat.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bHangsAreFatal | bool | HAL/ThreadHeartBeat.h | ||
| bReadyToCheckHeartbeat | FThreadSafeBool | True if heartbeat should be measured | HAL/ThreadHeartBeat.h | |
| CheckpointHeartBeat | TMap< FName, FHeartBeatInfo > | Keeps track of the last heartbeat time for a checkpoint | HAL/ThreadHeartBeat.h | |
| CheckpointHeartBeatCritical | FCriticalSection | Synch object for the checkpoint heartbeat | HAL/ThreadHeartBeat.h | |
| CheckpointSuspendCount | int32 | HAL/ThreadHeartBeat.h | ||
| Clock | FThreadHeartBeatClock | HAL/ThreadHeartBeat.h | ||
| ConfigHangDuration | double | Max time the thread is allowed to not send the heartbeat | HAL/ThreadHeartBeat.h | |
| ConfigPresentDuration | double | HAL/ThreadHeartBeat.h | ||
| ConfigStuckDuration | double | HAL/ThreadHeartBeat.h | ||
| CurrentHangDuration | double | HAL/ThreadHeartBeat.h | ||
| CurrentPresentDuration | double | HAL/ThreadHeartBeat.h | ||
| CurrentStuckDuration | double | HAL/ThreadHeartBeat.h | ||
| FunctionHeartBeat | TMap< uint32, FHeartBeatInfo > | Keeps track of the last heartbeat time for a function, can't be nested | HAL/ThreadHeartBeat.h | |
| FunctionHeartBeatCritical | FCriticalSection | Synch object for the function heartbeat | HAL/ThreadHeartBeat.h | |
| GlobalSuspendCount | FThreadSafeCounter | HAL/ThreadHeartBeat.h | ||
| HangDurationMultiplier | double | HAL/ThreadHeartBeat.h | ||
| HeartBeatCritical | FCriticalSection | Synch object for the heartbeat | HAL/ThreadHeartBeat.h | |
| LastHangCallstackCRC | uint32 | CRC of the last hang's callstack | HAL/ThreadHeartBeat.h | |
| LastHungThreadId | uint32 | Id of the last thread that hung | HAL/ThreadHeartBeat.h | |
| LastStuckThreadId | uint32 | HAL/ThreadHeartBeat.h | ||
| OnHangDelegate | FOnHangDelegate | HAL/ThreadHeartBeat.h | ||
| OnStuck | FOnThreadStuck | HAL/ThreadHeartBeat.h | ||
| OnUnstuck | FOnThreadUnstuck | HAL/ThreadHeartBeat.h | ||
| PresentHeartBeat | FHeartBeatInfo | The last heartbeat time for the rendering or RHI thread frame present. | HAL/ThreadHeartBeat.h | |
| StopTaskCounter | FThreadSafeCounter | Stops this thread | HAL/ThreadHeartBeat.h | |
| Thread | FRunnableThread * | Thread to run the worker FRunnable on | HAL/ThreadHeartBeat.h | |
| ThreadHeartBeat | TMap< uint32, FHeartBeatInfo > | Keeps track of the last heartbeat time for threads | HAL/ThreadHeartBeat.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint32 CheckCheckpointHeartBeat
(
double& OutHangDuration |
Called by a supervising thread to check all checkpoints forward progress | HAL/ThreadHeartBeat.h | |
uint32 CheckFunctionHeartBeat
(
double& OutHangDuration |
Called by a supervising thread to check all function calls' being monitored health | HAL/ThreadHeartBeat.h | |
uint32 CheckHeartBeat
(
double& OutHangDuration |
Called by a supervising thread to check the threads' health | HAL/ThreadHeartBeat.h | |
double GetHangDuration() |
Get hang duration threshold. | HAL/ThreadHeartBeat.h | |
uint32 GetLastHungThreadId () |
Get the Id of the last thread to trigger the hang detector. | HAL/ThreadHeartBeat.h | |
uint32 GetLastStuckThreadId () |
Get the Id of the last thread to pass the stuck thread time. | HAL/ThreadHeartBeat.h | |
FOnHangDelegate & GetOnHangDelegate () |
Get delegate for callback on hang. | HAL/ThreadHeartBeat.h | |
FOnThreadStuck & GetOnThreadStuck() |
Get delegate for callback on stuck or unstuck thread. | HAL/ThreadHeartBeat.h | |
FOnThreadUnstuck & GetOnThreadUnstuck() |
HAL/ThreadHeartBeat.h | ||
void HeartBeat () |
HAL/ThreadHeartBeat.h | ||
void HeartBeat
(
bool bReadConfig |
Called from a thread once per frame to update the heartbeat time | HAL/ThreadHeartBeat.h | |
void InitSettings() |
Update settings from command line or ini | HAL/ThreadHeartBeat.h | |
bool IsBeating() |
Returns true/false if this thread is currently performing heartbeat monitoring | HAL/ThreadHeartBeat.h | |
void KillHeartBeat() |
Called by a thread when it's no longer expecting to be ticked | HAL/ThreadHeartBeat.h | |
void MonitorCheckpointEnd
(
FName CheckPoint |
Called from a thread when a checkpoint has ended | HAL/ThreadHeartBeat.h | |
void MonitorCheckpointStart
(
FName EndCheckPoint, |
Called from a thread to register a checkpoint to be monitored | HAL/ThreadHeartBeat.h | |
void MonitorFunctionEnd() |
Called by a thread when a function has completed and no longer needs to be monitored | HAL/ThreadHeartBeat.h | |
void MonitorFunctionStart() |
Called from a thread once on entry to a function to be monitored | HAL/ThreadHeartBeat.h | |
void PresentFrame() |
Called from the rendering or RHI thread when the platform RHI presents a frame (supported platforms only). | HAL/ThreadHeartBeat.h | |
void ResumeHeartBeat
(
bool bAllThreads |
Resume heartbeat measuring for the current thread | HAL/ThreadHeartBeat.h | |
void SetDurationMultiplier
(
double NewMultiplier |
Sets a multiplier to the hang duration (>= 1.0). | HAL/ThreadHeartBeat.h | |
void Start() |
Begin measuring heartbeat | HAL/ThreadHeartBeat.h | |
void SuspendHeartBeat
(
bool bAllThreads |
Suspend heartbeat measuring for the current thread if the thread has already had a heartbeat | HAL/ThreadHeartBeat.h |
Overridden from FRunnable
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool Init () |
Initializes the runnable object. | HAL/ThreadHeartBeat.h | |
virtual uint32 Run () |
Runs the runnable object. | HAL/ThreadHeartBeat.h | |
virtual void Stop () |
Stops the runnable object.This is called if a thread is requested to terminate early. | HAL/ThreadHeartBeat.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FThreadHeartBeat & Get() |
Gets the heartbeat singleton | HAL/ThreadHeartBeat.h | |
static FThreadHeartBeat * GetNoInit() |
HAL/ThreadHeartBeat.h |