cppreference.com
创建账户
登录
名字空间
页面
讨论
变换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
台灣正體
查看
查看
编辑
历史
操作
std::shared_lock<Mutex>::
owns_lock
来自cppreference.com
<
cpp
|
thread
|
shared lock
C++
语言
标准库头文件
自立与有宿主实现
具名要求
语言支持库
概念库
(C++20)
诊断库
工具库
字符串库
容器库
迭代器库
范围库
(C++20)
算法库
数值库
本地化库
输入/输出库
文件系统库
(C++17)
正则表达式库
(C++11)
原子操作库
(C++11)
线程支持库
(C++11)
技术规范
[编辑]
线程支持库
线程
thread
(C++11)
jthread
(C++20)
stop_token
(C++20)
stop_source
(C++20)
stop_callback
(C++20)
hardware_destructive_interference_size
hardware_constructive_interference_size
(C++17)
(C++17)
this_thread
命名空间
get_id
(C++11)
yield
(C++11)
sleep_for
(C++11)
sleep_until
(C++11)
互斥
mutex
(C++11)
recursive_mutex
(C++11)
shared_mutex
(C++17)
timed_mutex
(C++11)
recursive_timed_mutex
(C++11)
shared_timed_mutex
(C++14)
通用锁管理
lock_guard
(C++11)
scoped_lock
(C++17)
unique_lock
(C++11)
shared_lock
(C++14)
defer_lock_t
try_to_lock_t
adopt_lock_t
(C++11)
(C++11)
(C++11)
lock
(C++11)
try_lock
(C++11)
defer_lock
try_to_lock
adopt_lock
(C++11)
(C++11)
(C++11)
once_flag
(C++11)
call_once
(C++11)
条件变量
condition_variable
(C++11)
condition_variable_any
(C++11)
notify_all_at_thread_exit
(C++11)
cv_status
(C++11)
信号量
counting_semaphore
binary_semaphore
(C++20)
(C++20)
闩与屏障
latch
(C++20)
barrier
(C++20)
future
promise
(C++11)
future
(C++11)
shared_future
(C++11)
packaged_task
(C++11)
async
(C++11)
launch
(C++11)
future_status
(C++11)
future_error
(C++11)
future_category
(C++11)
future_errc
(C++11)
[编辑]
std::shared_lock
成员函数
shared_lock::shared_lock
shared_lock::~shared_lock
shared_lock::operator=
共享锁定
shared_lock::lock
shared_lock::try_lock
shared_lock::try_lock_for
shared_lock::try_lock_until
shared_lock::unlock
修改器
shared_lock::swap
shared_lock::release
观察器
shared_lock::mutex
shared_lock::owns_lock
shared_lock::operator bool
非成员函数
std::swap(shared_lock)
[编辑]
bool
owns_lock
(
)
const
noexcept
;
(C++14 起)
检查
*
this
是否拥有已锁的互斥。
[
编辑
]
参数
(无)
[
编辑
]
返回值
若
*
this
拥有关联互斥且已获得其共享所有权,则为
true
,否则为
false
。
[
编辑
]
参阅
operator bool
测试锁是否占有其关联的互斥
(公开成员函数)
[编辑]