FScopeLock

Implements a scope lock.

Windows
MacOS
Linux

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

Name Description

Public function

FScopeLock

(
    FCriticalSection* InSynchObjec...
)

Constructor that performs a lock on the synchronization object

Destructors

Name Description

Public function

~FScopeLock()

Destructor that performs a release on the synchronization object.

Functions

Name Description

Public function

void

 

Unlock()

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss