bool TimedMutex::timed_lock(
const std::chrono::duration<Rep, Period>& duration) {
auto result = lockHelper([&](MutexWaiter& waiter) {
- if (!waiter.baton.timed_wait(duration)) {
+ if (!waiter.baton.try_wait_for(duration)) {
// We timed out. Two cases:
// 1. We're still in the waiter list and we truly timed out
// 2. We're not in the waiter list anymore. This could happen if the baton
read_waiters_.push_back(waiter);
ulock.unlock();
- if (!waiter.baton.timed_wait(duration)) {
+ if (!waiter.baton.try_wait_for(duration)) {
// We timed out. Two cases:
// 1. We're still in the waiter list and we truly timed out
// 2. We're not in the waiter list anymore. This could happen if the baton
write_waiters_.push_back(waiter);
ulock.unlock();
- if (!waiter.baton.timed_wait(duration)) {
+ if (!waiter.baton.try_wait_for(duration)) {
// We timed out. Two cases:
// 1. We're still in the waiter list and we truly timed out
// 2. We're not in the waiter list anymore. This could happen if the baton