Navigation
API > API/Runtime > API/Runtime/Core
Implements a scope lock.
This is a utility class that handles scope level locking. It's very useful to keep from causing deadlocks due to exceptions being caught and knowing about the number of locks a given thread has on a resource. Example:
` { // Synchronize thread access to the following data FScopeLock ScopeLock(SyncObject); // Access data that is shared among multiple threads ... // When ScopeLock goes out of scope, other threads can access data } _
| Name | FScopeLock |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/ScopeLock.h |
| Include Path | #include "Misc/ScopeLock.h" |
Syntax
class FScopeLock : private UE::TScopeLock< FCriticalSection >
Inheritance Hierarchy
- TScopeLock → FScopeLock
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FScopeLock
(
TNotNull< FCriticalSection* > InSyncObject |
Constructor that performs a lock on the synchronization object | Misc/ScopeLock.h |