Navigation
Unreal Engine C++ API Reference > Runtime > Core > Misc
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Misc/ScopeLock.h |
Include | #include "Misc/ScopeLock.h" |
Syntax
class FScopeLock
Remarks
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(SynchObject); // Access data that is shared among multiple threads ... // When ScopeLock goes out of scope, other threads can access data } _
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
FScopeLock
(
FCriticalSection* InSynchObject |
Constructor that performs a lock on the synchronization object |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() |
~FScopeLock () |
Destructor that performs a release on the synchronization object. |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Unlock () |