librf
Public 成员函数 | 所有成员列表
resumef::batch_lock_t< _Ty, _Cont, _Assemble > 模板类 参考

无死锁的批量枷锁。 更多...

Public 成员函数

 batch_lock_t (_Cont &locks_)
 通过锁容器构造,并立刻应用加锁算法。
 
 batch_lock_t (_Cont &locks_, _Assemble &la_)
 通过锁容器和锁集合构造,并立刻应用加锁算法。
 
 batch_lock_t (std::adopt_lock_t, _Cont &locks_)
 通过锁容器构造,容器里的锁已经全部获得。
 
 batch_lock_t (std::adopt_lock_t, _Cont &locks_, _Assemble &la_)
 通过锁容器和锁集合构造,容器里的锁已经全部获得。
 
 ~batch_lock_t () noexcept
 析构函数里,释放容器里的锁。
 
void unlock ()
 手工释放容器里的锁,析构函数里将不再有释放操作。
 
 batch_lock_t (const batch_lock_t &)=delete
 不支持拷贝构造。
 
batch_lock_toperator= (const batch_lock_t &)=delete
 不支持拷贝赋值。
 
 batch_lock_t (batch_lock_t &&_Right)
 支持移动构造。
 
batch_lock_toperator= (batch_lock_t &&_Right)
 支持移动赋值。
 

详细描述

template<class _Ty, class _Cont = std::vector<_Ty>, class _Assemble = detail::_LockVectorAssembleT<_Ty, _Cont>>
class resumef::batch_lock_t< _Ty, _Cont, _Assemble >

无死锁的批量枷锁。

参数
_Ty锁的类型。例如std::mutex,resumef::spinlock,resumef::mutex_t(线程用法)均可。
_Cont容纳一批锁的容器。
_Assemble与_Cont配套的锁集合,特化了如何操作_Ty。

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