慕姐8265434
根据c++源码看,超时后会退出阻塞,继续执行后续代码template <class Rep, class Period>cv_status wait_for (unique_lock<mutex>& lck,const chrono::duration<Rep,Period>& rel_time);return wait_until (lck,chrono::steady_clock::now() + rel_time, std::move(pred));带谓词template <class Rep, class Period, class Predicate>bool wait_for (unique_lock<mutex>& lck,const chrono::duration<Rep,Period>& rel_time, Predicate pred);while (!pred())if (wait_until(lck,abs_time) == cv_status::timeout) return pred();//超时后调用谓词并返回结果,true or falsereturn true;