[英]std::condition_variable::wait_until function
I have a small question about using this method. 关于使用此方法,我有一个小问题。 Will my thread wake up if the
std::chrono::high_resolution_clock::now()
is greater then the second parameter( abs_time
)? 如果
std::chrono::high_resolution_clock::now()
大于第二个参数( abs_time
),我的线程会唤醒吗?
Section 30.2.4 [thread.req.timing] (more-or-less accurate version available at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3128.html#thread.req.timing ) says: 第30.2.4节[thread.req.timing](或多或少的准确版本,请参见http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3128.html#thread .req.timing )说:
if Ca > Ct, the waiting function should wake as soon as possible, ie Ca + Di + Dm, since the timeout is already satisfied.
如果Ca> Ct,则等待功能应尽快唤醒,即Ca + Di + Dm,因为已经满足超时要求。
So the answer to your question is "yes". 因此,您的问题的答案是“是”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.