Navigation
API > API/Runtime > API/Runtime/Chaos
Recursive Read/Write lock object for protecting external data accesses for physics scenes. This is a fairly heavy lock designed to allow scene queries and user code to safely access external physics data.
The lock also allows a thread to recursively lock data to avoid deadlocks on repeated writes or undefined behavior for nesting read locks.
Fairness is determined by the underlying platform FRWLock type as this lock uses FRWLock as it's internal primitive
| Name | FPhysicsSceneGuard |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Framework/Threading.h |
| Include Path | #include "Framework/Threading.h" |
Syntax
class FPhysicsSceneGuard
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Framework/Threading.h | |||
FPhysicsSceneGuard
(
const FPhysicsSceneGuard& InOther |
Framework/Threading.h | ||
FPhysicsSceneGuard
(
FPhysicsSceneGuard&& InOther |
Framework/Threading.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FPhysicsSceneGuard() |
Framework/Threading.h |
Classes
| Name | Remarks |
|---|---|
| FSceneLockTls | We use 32 bits to store our depths (16 read and 16 write) allowing a maximum recursive lock of depth 65,536. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CurrentWriterThreadId | TAtomic< uint32 > | Framework/Threading.h | ||
| InnerLock | FRWLock | Framework/Threading.h | ||
| TlsSlot | uint32 | Framework/Threading.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ReadLock() |
Framework/Threading.h | ||
void ReadUnlock() |
Framework/Threading.h | ||
void WriteLock() |
Framework/Threading.h | ||
void WriteUnlock() |
Framework/Threading.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FPhysicsSceneGuard & operator=
(
const FPhysicsSceneGuard& InOther |
Framework/Threading.h | ||
FPhysicsSceneGuard & operator=
(
FPhysicsSceneGuard&& InOther |
Framework/Threading.h |