简体   繁体   中英

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 )?

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:

if Ca > Ct, the waiting function should wake as soon as possible, ie Ca + Di + Dm, since the timeout is already satisfied.

So the answer to your question is "yes".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM