C++0x allows to lock on a mutex until a given time is reached, and return a boolean stating if the mutex has been locked or not.
template <class Clock, class Duration>
bool try_lock_until(const chrono::time_point<Clock,
Duration>& abs_time);
In some contexts, I consider an exceptional situation that the locking fails because of timeout. In this case an exception should be more appropriated.
To make the difference a function lock_until could be used to get a timeout exception when the time is reached before locking.
template <class Clock, class Duration>
void lock_until(const chrono::time_point<Clock,
Duration>& abs_time);
Do you think that lock_until should be more adequate in some contexts? if yes, on which ones? If no, why try_lock_until will always be a better choice?