std::shared_lock::lock
STD::共享[医]锁::锁
void lock( | | (since C++14) |
---|
将关联的互斥锁在共享模式下。有效呼叫mutex()->lock_shared()...
参数
%280%29
返回值
%280%29
例外
- 引发的任何异常mutex()->lock_shared()
- 如果没有关联的互斥,
std::system_error
错误代码为std::errc::operation_not_permitted
- 如果关联的互斥对象已经被
shared_lock
28%,即,拥有[医]锁回报true
%29,std::system_error
错误代码为std::errc::resource_deadlock_would_occur
例
另见
try_lock | tries to lock the associated mutex (public member function) |
---|---|
unlock | unlocks the associated mutex (public member function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。