Attempt to acquire a shared lock on a std::shared_timed_mutex
object for
the current thread.
template<typename Clock,typename Duration> bool try_lock_shared_until( std::chrono::time_point<Clock,Duration> const& absolute_time);
Attempts to acquire a shared lock on *this
for the calling thread before
the time specified by absolute_time
.
If absolute_time<=Clock::now()
on entry then the call will return
immediately, as if it was a call to try_lock_shared()
.
Otherwise, the call shall block until either the lock has been
acquired or Clock::now()
returns a time equal to or later
than absolute_time
.
true
if a shared lock
was obtained for the calling thread, false
otherwise.
*this
is locked by the calling thread if the function returns true
.
Nothing.
If the calling thread already holds the lock on *this
, the function returns false
. The function may fail to
acquire the lock (and return false
)
even if no other thread holds a lock on *this
. There is no guarantee as to
how long the calling thread will be blocked for, only that if the
function returns false
then Clock::now()
returned a time equal to or later than absolute_time
at the point at which the thread became unblocked.
Nothing
#include <shared_mutex>