UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RaceDetector.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6
7#if USING_INSTRUMENTATION
8
9#include "Sanitizer/Types.h"
10#include "Misc/Timeout.h"
11
12namespace UE::Sanitizer::RaceDetector
13{
14 // Setup everything that is required for the race detector.
15 CORE_API bool Initialize();
16 // Cleanup everything about the race detector that was setup in Initialize.
17 CORE_API bool Shutdown();
18
20 // Set a callback that will be called whenever a race is detected (filters will not apply).
21 // NOTE: It is not safe to perform any allocation within the callback since it will be
22 // called from instrumentation code.
24 // Remove any callback that was previously set.
26
27 // Dump the current thread context to help with debugging.
28 CORE_API void DumpContext();
29 // Dump the current thread context but with additional info.
31
32 // Means that races that doesn't involve the current thread will be filtered.
33 CORE_API void ToggleFilterOtherThreads(bool bEnable);
34
35 // Toggle race detection until a call to the same function that toggles it back off.
36 // If multiple threads activate race detection at the same time, it will be turned off when all thread toggle it back to off.
37 // The grace period is how much time to wait until race detection is really turned off. Can be used when toggling is expected to happen too often or too fast.
38 CORE_API void ToggleRaceDetection(bool bEnable, float GracePeriodSeconds = 0.0f);
39 // Toggle filter on duplicate races. Does not apply when a callback is set.
40 CORE_API void ToggleFilterDuplicateRaces(bool bEnable);
41 // Activate race detection for certain time after which it will be automatically turned off.
43
44 // Toggle detailed logging globally for all threads. Very slow!
45 CORE_API void ToggleGlobalDetailedLog(bool bEnable);
46 // Toggle detailed logging for the current thread.
47 CORE_API void ToggleThreadDetailedLog(bool bEnable);
48 // Toggle detailed logging filter to only log activity for a specific address.
49 // NOTE: Set to nullptr to remove filtering.
51 // Returns whether the race detector is currently active or not.
52 CORE_API bool IsActive();
53
55 {
58 public:
62 {
64 {
66 }
67 }
68
70 {
72 {
74 }
75 }
76 };
77
78
79} // UE::Sanitizer::RaceDetector
80
81#endif
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AssetRegistryState.h:50
Definition Timeout.h:21