This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API Reference
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine::ScopedMutexLock Class

Header: #include <UnigineThread.h>

Template class that implements the RAII (Resource Acquisition Is Initialization) pattern to manage mutex locking in a multithreaded environment. This class ensures that a mutex is automatically locked upon construction and unlocked when the object goes out of scope.

This class has the following aliases:

Alias Description Type
ScopedSpinLock
ScopedLock
Alias for ScopedMutexLock using MutexSpin class for spin-based scoped locking. Ensures the spinlock is acquired on construction and released on destruction. MutexSpin
ScopedReentrantSpinLock
ScopedReentrantLock
Alias for ScopedMutexLock using ReentrantMutexSpin enabling scoped locking of reentrant spinlocks. ReentrantMutexSpin
ScopedCriticalSectionLock Alias for ScopedMutexLock using MutexCriticalSection. Provides scoped RAII-style locking using a Windows CRITICAL_SECTION. MutexCriticalSection
ScopedSlimLock Alias for ScopedMutexLock using MutexSlim. Provides scoped RAII-style locking using a Windows SRW Lock. MutexSlim
ScopedReentrantSlimLock Alias for ScopedMutexLock using ReentrantMutexSlim. Provides scoped RAII-style locking with support for reentrance using a Windows SRW Lock. ReentrantMutexSlim
ScopedSlimAdvanceLock Alias for ScopedMutexLock using MutexSlimAdvance. Provides RAII-style scoped locking with the ability to check whether the lock is currently held using a Windows SRW Lock. MutexSlimAdvance
ScopedCriticalSectionAdvanceLock Alias for ScopedMutexLock using MutexCriticalSectionAdvance. Provides RAII-style scoped locking with the ability to check whether the lock is currently held using a Windows CRITICAL_SECTION. MutexCriticalSectionAdvance
ScopedPThreadLock Alias for ScopedMutexLock using MutexPThread. Provides scoped RAII-style locking via Linux pthread_mutex_t mutex. MutexPThread
ScopedReentrantPThreadLock Alias for ScopedMutexLock using ReentrantMutexPThread. Provides scoped locking with reentrance via Linux pthread_mutex_t mutex. ReentrantMutexPThread
ScopedPThreadAdvanceLock Alias for ScopedMutexLock using MutexPThreadAdvance. Provides scoped locking with internal state tracking via Linux pthread_mutex_t mutex. MutexPThreadAdvance

ScopedMutexLock Class

Members


ScopedMutexLock ( MutexType& m ) #

Constructor that locks the provided mutex. The lock remains held for the duration of the ScopedMutexLock object's lifetime.

Arguments

  • MutexType& m - A reference to a mutex object to be locked. The mutex must provide lock() and unlock() member functions.

~ScopedMutexLock ( ) #

Destructor that automatically unlocks the mutex when the ScopedMutexLock object goes out of scope.

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2025-07-10
Build: ()