This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口(API)参考
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
创建内容
内容优化
材质
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: ()