+ template<class P>
+ bool wait_until(std::unique_lock<Mutex>& lock, double timeout_time, P pred)
+ {
+ while (!pred())
+ if (this->wait_until(lock, timeout_time) == std::cv_status::timeout)
+ return pred();
+ return true;
+ }
+ template<class P>
+ bool wait_for(std::unique_lock<Mutex>& lock, double duration, P pred)
+ {
+ return this->wait_until(lock, SIMIX_get_clock() + duration, std::move(pred));
+ }