Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FScopeLock Class Reference

#include <ScopeLock.h>

+ Collaboration diagram for FScopeLock:

Public Member Functions

UE_NODISCARD_CTOR FScopeLock (FCriticalSection *InSynchObject)
 
 ~FScopeLock ()
 
void Unlock ()
 

Private Member Functions

 FScopeLock ()
 
 FScopeLock (const FScopeLock &InScopeLock)
 
FScopeLockoperator= (FScopeLock &InScopeLock)
 

Private Attributes

FCriticalSectionSynchObject
 

Detailed Description

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 }

Definition at line 26 of file ScopeLock.h.

Constructor & Destructor Documentation

◆ FScopeLock() [1/3]

UE_NODISCARD_CTOR FScopeLock::FScopeLock ( FCriticalSection * InSynchObject)
inline

Constructor that performs a lock on the synchronization object

Parameters
InSynchObjectThe synchronization object to manage

Definition at line 35 of file ScopeLock.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~FScopeLock()

FScopeLock::~FScopeLock ( )
inline

Destructor that performs a release on the synchronization object.

Definition at line 43 of file ScopeLock.h.

+ Here is the call graph for this function:

◆ FScopeLock() [2/3]

FScopeLock::FScopeLock ( )
private

Default constructor (hidden on purpose).

◆ FScopeLock() [3/3]

FScopeLock::FScopeLock ( const FScopeLock & InScopeLock)
private

Copy constructor( hidden on purpose).

Member Function Documentation

◆ operator=()

FScopeLock & FScopeLock::operator= ( FScopeLock & InScopeLock)
inlineprivate

Assignment operator (hidden on purpose).

Definition at line 66 of file ScopeLock.h.

◆ Unlock()

void FScopeLock::Unlock ( )
inline

Definition at line 48 of file ScopeLock.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ SynchObject

FCriticalSection* FScopeLock::SynchObject
private

Definition at line 74 of file ScopeLock.h.


The documentation for this class was generated from the following file: