相关疑难解决方法(0)

std :: timed_mutex :: try_lock*虚假失败

通过try_lock*,我采取的意思是try_lock(),try_lock_for()try_lock_until().根据cppreference,这三种方法可能只是虚假地失败.以下是从描述中引用的try_lock_for()

与此同时try_lock(),false即使互斥锁在某个时刻未被任何其他线程锁定,也允许此函数虚假失败并返回timeout_duration.

我知道可能会发生虚假的唤醒std::condition_variable及其背后的基本原理.但是,互斥量是什么情况?

c++ multithreading mutex thread-synchronization c++11

11
推荐指数
2
解决办法
1487
查看次数