* @{
*/
- /// cv_status
- enum class cv_status { no_timeout, timeout };
-
/// condition_variable
class condition_variable
{
}
template<typename _Duration>
- cv_status
+ bool
wait_until(unique_lock<mutex>& __lock,
const chrono::time_point<__clock_t, _Duration>& __atime)
{ return __wait_until_impl(__lock, __atime); }
template<typename _Clock, typename _Duration>
- cv_status
+ bool
wait_until(unique_lock<mutex>& __lock,
const chrono::time_point<_Clock, _Duration>& __atime)
{
_Predicate __p)
{
while (!__p())
- if (wait_until(__lock, __atime) == cv_status::timeout)
+ if (!wait_until(__lock, __atime))
return __p();
return true;
}
template<typename _Rep, typename _Period>
- cv_status
+ bool
wait_for(unique_lock<mutex>& __lock,
const chrono::duration<_Rep, _Period>& __rtime)
{ return wait_until(__lock, __clock_t::now() + __rtime); }
private:
template<typename _Clock, typename _Duration>
- cv_status
+ bool
__wait_until_impl(unique_lock<mutex>& __lock,
const chrono::time_point<_Clock, _Duration>& __atime)
{
__gthread_cond_timedwait(&_M_cond, __lock.mutex()->native_handle(),
&__ts);
- return (_Clock::now() < __atime
- ? cv_status::no_timeout : cv_status::timeout);
+ return _Clock::now() < __atime;
}
};
wait(_Lock& __lock, _Predicate __p);
template<typename _Lock, typename _Clock, typename _Duration>
- cv_status
+ bool
wait_until(_Lock& __lock,
const chrono::time_point<_Clock, _Duration>& __atime);
_Predicate __p);
template<typename _Lock, typename _Rep, typename _Period>
- cv_status
+ bool
wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime);
template<typename _Lock, typename _Rep,