Add Mutex::trylock_until and trylock_for
Given the 64-bit timebase, add trylock_until to Mutex.

Naming is based on a combination of Mutex::trylock, Thread::wait_until,
and C++11 timed_mutex::try_lock_until.

pthreads and C11 use "timedlock", but that's not a good fit against our
existing trylock() and lock(timeout) - they have only absolute-time
waits, not relative.

To increase the similarity to C++11, add trylock_for - same parameters
as lock, but with the bool return value of trylock and trylock_until.

Add an assertion when convering status codes to booleans to check that
there are no non-timeout errors.
ls
1 parent bbefeb4 commit cd573a603fb35f974d5421cbf33cf90e8c0f5ed2
@Kevin Bracey Kevin Bracey authored on 10 Nov 2017
Showing 2 changed files
View
rtos/Mutex.cpp
View
rtos/Mutex.h