Navigation
API > API/Runtime > API/Runtime/Core
A shared mutex ownership wrapper that allows dynamic locking, unlocking, and deferred locking.
LockType must contain LockShared() and UnlockShared() functions.
Use with mutex types like FSharedMutex and FSharedRecursiveMutex.
| Name | TDynamicSharedLock |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Async/SharedLock.h |
| Include Path | #include "Async/SharedLock.h" |
Syntax
template<typename LockType>
class TDynamicSharedLock
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Async/SharedLock.h | |||
TDynamicSharedLock
(
const TDynamicSharedLock& |
Async/SharedLock.h | ||
TDynamicSharedLock
(
LockType& Lock |
Wrap a mutex and lock it in shared mode. | Async/SharedLock.h | |
TDynamicSharedLock
(
TDynamicSharedLock&& Other |
Move from another lock, transferring any ownership to this lock. | Async/SharedLock.h | |
TDynamicSharedLock
(
LockType& Lock, |
Wrap a mutex without locking it in shared mode. | Async/SharedLock.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TDynamicSharedLock() |
Unlock the mutex if locked. | Async/SharedLock.h |
Class Specializations
| Name | Remarks |
|---|---|
| TDynamicSharedLock< FSharedRecursiveMutex > |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bLocked | bool | Async/SharedLock.h | ||
| Mutex | LockType * | Async/SharedLock.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Lock() |
Lock the associated mutex in shared mode. This lock must have a mutex and must not be locked. | Async/SharedLock.h | |
bool OwnsLock() |
Returns true if this lock has its associated mutex locked. | Async/SharedLock.h | |
bool TryLock () |
Try to lock the associated mutex in shared mode. | Async/SharedLock.h | |
void Unlock() |
Unlock the associated mutex in shared mode. This lock must have a mutex and must be locked. | Async/SharedLock.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
operator bool() |
Returns true if this lock has its associated mutex locked. | Async/SharedLock.h | |
TDynamicSharedLock & operator=
(
const TDynamicSharedLock& |
Async/SharedLock.h | ||
TDynamicSharedLock & operator=
(
TDynamicSharedLock&& Other |
Move from another lock, transferring any ownership to this lock, and unlocking the previous mutex if locked. | Async/SharedLock.h |