Navigation
API > API/Runtime > API/Runtime/Core
Race detector supporting multiple readers (MR) single writer (SW) recursive access, a write from inside a read, a read from inside a write and all other combinations. is zero initializable. supports destruction while being "accessed"
| Name | FMRSWRecursiveAccessDetector |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/MTAccessDetector.h |
| Include Path | #include "Misc/MTAccessDetector.h" |
Syntax
class FMRSWRecursiveAccessDetector
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMRSWRecursiveAccessDetector
(
const FMRSWRecursiveAccessDetector& Other |
Just default initialisation, the copy is not being accessed | Misc/MTAccessDetector.h | |
| Misc/MTAccessDetector.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FMRSWRecursiveAccessDetector() |
Misc/MTAccessDetector.h |
Classes
| Name | Remarks |
|---|---|
| FState |
Structs
| Name | Remarks |
|---|---|
| FDestructionSentinel | |
| FReaderNum | To support a write access from inside a read access on the same thread, we need to know that there're no readers on other threads. |
Enums
Public
| Name | Remarks |
|---|---|
| EAccessType | DestructionSentinel This access detector supports its destruction (along with its owner) while being "accessed". |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FDestructionSentinelStackTls | TArray< FDestructionSentinel *, TInlineAllocator< 4 > > | A TLS stack of destruction sentinels shared by all access detector instances on the callstack. | Misc/MTAccessDetector.h |
| FReadersTls | TArray< FReaderNum, TInlineAllocator< 4 > > | Misc/MTAccessDetector.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InvalidThreadId | uint32 | Despite 0 is a valid TID on some platforms, we store actual TID + 1 to avoid collisions. | Misc/MTAccessDetector.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| State | std::atomic< uint64 > | All atomic ops are relaxed to preserve the original memory order, as the detector is compiled out in non-dev builds | Misc/MTAccessDetector.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AcquireReadAccess () |
Misc/MTAccessDetector.h | ||
void AcquireReadAccess
(
FDestructionSentinel& DestructionSentinel |
An overload that handles access detector destruction from inside a read access, must be used along with the corresponding overload of `ReleaseReadAcess_ | Misc/MTAccessDetector.h | |
void AcquireWriteAccess () |
Misc/MTAccessDetector.h | ||
void AcquireWriteAccess
(
FDestructionSentinel& DestructionSentinel |
An overload that handles access detector destruction from inside a write access, must be used along with the corresponding overload of `ReleaseWriteAcess_ | Misc/MTAccessDetector.h | |
void ReleaseReadAccess () |
Misc/MTAccessDetector.h | ||
void ReleaseReadAccess
(
FDestructionSentinel& DestructionSentinel |
An overload that handles access detector destruction from inside a read access, must be used along with the corresponding overload of `AcquireReadAcess_ | Misc/MTAccessDetector.h | |
void ReleaseWriteAccess () |
Misc/MTAccessDetector.h | ||
void ReleaseWriteAccess
(
FDestructionSentinel& DestructionSentinel |
An overload that handles access detector destruction from inside a write access, must be used along with the corresponding overload of `AcquireWriteAcess_ | Misc/MTAccessDetector.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void CheckOtherThreadWriters
(
FState InState |
Misc/MTAccessDetector.h | ||
static FString GetCurrentThreadCallstack() |
Misc/MTAccessDetector.h | ||
static FDestructionSentinelStackTls & GetDestructionSentinelStackTls() |
Misc/MTAccessDetector.h | ||
static FReadersTls & GetReadersTls() |
Misc/MTAccessDetector.h | ||
static FString GetThreadCallstack
(
uint32 ThreadId |
Misc/MTAccessDetector.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMRSWRecursiveAccessDetector & operator=
(
const FMRSWRecursiveAccessDetector& Other |
Do not alter the state, it can be accessed | Misc/MTAccessDetector.h |