std::shared_lock::try_lock_for

template< class Rep, class Period > bool try_lock_for( const std::chrono::duration<Rep,Period>& timeout_duration ); (since C++14) Tries to lock the associated mutex in shared mode. Blocks until specified timeout_duration has elapsed or the lock is acquired, whichever comes first. On successful lock acquisition returns true, otherwise returns false. Effectively calls mutex()->try_lock_shared_for(timeout_duration). A steady clock is used to measure the duration. This fu

std::shared_lock::swap

template< class Mutex > void swap( shared_lock<Mutex>& other ); (since C++14) Exchanges the internal states of the lock objects. Parameters other - the lock to swap the state with Return value (none). Exceptions noexcept specification: noexcept Example See also std::swap(std::shared_lock) specialization of std::swap for shared_lock (function template)

std::shared_lock::try_lock

bool try_lock(); (since C++14) Tries to lock the associated mutex in shared mode without blocking. Effectively calls mutex()->try_lock_shared(). std::system_error is thrown if there is no associated mutex or if the mutex is already locked. Parameters (none). Return value true if the ownership of the mutex has been acquired successfully, false otherwise. Exceptions Any exceptions thrown by mutex()->try_lock_shared() If there is no associated mutex, std::system_error wit

std::shared_lock::owns_lock

bool owns_lock() const; (since C++14) Checks whether *this owns a locked mutex or not. Parameters (none). Return value true if *this has an associated mutex and has acquired shared ownership of it, false otherwise. Exceptions noexcept specification: noexcept See also operator bool tests whether the lock owns its associated mutex (public member function)

std::shared_lock::lock

void lock(); (since C++14) Locks the associated mutex in shared mode. Effectively calls mutex()->lock_shared(). Parameters (none). Return value (none). Exceptions Any exceptions thrown by mutex()->lock_shared() If there is no associated mutex, std::system_error with an error code of std::errc::operation_not_permitted If the associated mutex is already locked by this shared_lock (that is, owns_lock returns true), std::system_error with an error code of std::errc::reso

std::shared_lock::operator bool

explicit operator bool() const; (since C++14) Checks whether *this owns a locked mutex or not. Effectively calls owns_lock(). Parameters (none). Return value true if *this has an associated mutex and has acquired shared ownership of it, false otherwise. Exceptions noexcept specification: noexcept See also owns_lock tests whether the lock owns its associated mutex (public member function)

std::shared_lock::mutex

mutex_type* mutex() const; (since C++14) Returns a pointer to the associated mutex, or a null pointer if there is no associated mutex. Parameters (none). Return value Pointer to the associated mutex or a null pointer if there is no associated mutex. Exceptions noexcept specification: noexcept Example

std::shared_future::wait

void wait() const; (since C++11) Blocks until the result becomes available. valid() == true after the call. The behavior is undefined if valid()== false before the call to this function. Parameters (none). Return value (none). Exceptions (none). Notes The implementations are encouraged to detect the case when valid == false before the call and throw a std::future_error with an error condition of std::future_errc::no_state. Calling wait on the same std::shared_future from mul

std::shared_future::wait_for

template< class Rep, class Period > std::future_status wait_for( const std::chrono::duration<Rep,Period>& timeout_duration ) const; (since C++11) Waits for the result to become available. Blocks until specified timeout_duration has elapsed or the result becomes available, whichever comes first. Returns value identifies the state of the result. A steady clock is used to measure the duration. This function may block for longer than timeout_duration due to scheduling or res

std::shared_future::wait_until

template< class Clock, class Duration > std::future_status wait_until( const std::chrono::time_point<Clock,Duration>& timeout_time ) const; (since C++11) wait_until waits for a result to become available. It blocks until specified timeout_time has been reached or the result becomes available, whichever comes first. The return value indicates why wait_until returned. The behavior is undefined if valid()== false before the call to this function. Parameters timeout_time