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::shared_lock

shared_lock(); (1) (since C++14) shared_lock( shared_lock&& other ); (2) (since C++14) explicit shared_lock( mutex_type& m ); (3) (since C++14) shared_lock( mutex_type& m, std::defer_lock_t t ); (4) (since C++14) shared_lock( mutex_type& m, std::try_to_lock_t t ); (5) (since C++14) shared_lock( mutex_type& m, std::adopt_lock_t t ); (6) (since C++14) template< class Rep, class Period > shared_lock( mutex_type& m,

std::shared_lock::release

mutex_type* release(); (since C++14) Breaks the association of the associated mutex, if any, and *this. No locks are unlocked. If the *this held ownership of the associated mutex prior to the call, the caller is now responsible to unlock the mutex. Parameters (none). Return value Pointer to the associated mutex or NULL if there was no associated mutex. Exceptions noexcept specification: noexcept Example See also unlock unlocks the associated mutex (public member fun

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::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_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

Defined in header <shared_mutex> template< class Mutex > class shared_lock; (since C++14) The class shared_lock is a general-purpose shared mutex ownership wrapper allowing deferred locking, timed locking and transfer of lock ownership. Locking a shared_lock locks the associated shared mutex in shared mode (to lock it in exclusive mode, std::unique_lock can be used). The shared_lock class is movable, but not copyable -- it meets the requirements of MoveConstructible a

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

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