MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
lock< Mutex, WithDefer > 模板类 参考

锁管理器模板 更多...

#include <mutex.hpp>

Public 类型

using mutex_type = Mutex
 互斥锁类型

Public 成员函数

 lock (mutex_type &m)
 构造函数
 ~lock ()
 析构函数

详细描述

template<typename Mutex, bool WithDefer = false>
class lock< Mutex, WithDefer >

锁管理器模板

模板参数
Mutex互斥锁类型
WithDefer是否启用支持延迟锁操作的特化

RAII风格的锁管理器,在构造时锁定互斥锁,在析构时解锁。

在文件 mutex.hpp181 行定义.

构造及析构函数说明

◆ lock()

template<typename Mutex, bool WithDefer = false>
lock< Mutex, WithDefer >::lock ( mutex_type & m)
inlineexplicit

构造函数

参数
m要管理的互斥锁引用

构造时锁定互斥锁。

在文件 mutex.hpp195 行定义.

◆ ~lock()

template<typename Mutex, bool WithDefer = false>
lock< Mutex, WithDefer >::~lock ( )
inline

析构函数

析构时解锁互斥锁。

在文件 mutex.hpp204 行定义.


该类的文档由以下文件生成: