Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanups for condition_variable's waiting functions #3974

Merged
15 changes: 1 addition & 14 deletions stl/inc/mutex
Original file line number Diff line number Diff line change
Expand Up @@ -573,20 +573,7 @@ public:
template <class _Rep, class _Period>
cv_status wait_for(unique_lock<mutex>& _Lck, const chrono::duration<_Rep, _Period>& _Rel_time) {
// wait for duration
if (_Rel_time <= chrono::duration<_Rep, _Period>::zero()) {
return cv_status::timeout;
}

// TRANSITION, ABI: The standard says that we should use a steady clock,
// but unfortunately our ABI relies on the system clock.
_timespec64 _Tgt;
const bool _Clamped = _To_timespec64_sys_10_day_clamped(_Tgt, _Rel_time);
const cv_status _Result = _Wait_until_sys_time(_Lck, &_Tgt);
if (_Clamped) {
return cv_status::no_timeout;
}

return _Result;
return wait_until(_Lck, _To_absolute_time(_Rel_time));
}
achabense marked this conversation as resolved.
Show resolved Hide resolved

template <class _Rep, class _Period, class _Predicate>
Expand Down