[#std-shared_lock-0b] = xref:std.adoc[std]::xref:std/shared_lock-06.adoc[shared_lock]<xref:folly/SharedMutexImpl-09.adoc[folly::SharedMutexImpl<ReaderPriority, Tag_, Atom, Policy>]> :relfileprefix: ../ :mrdocs: std::shared_lock specialization for folly::SharedMutexImpl. == Synopsis Declared in `<folly/SharedMutex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< bool ReaderPriority, typename Tag_, template<typename> typename Atom, typename Policy> class xref:std/shared_lock-06.adoc[shared_lock]<xref:folly/SharedMutexImpl-09.adoc[folly::SharedMutexImpl<ReaderPriority, Tag_, Atom, Policy>]>; ---- == Description Uses the tokenful version of unlock_shared for faster unlocking by carrying a token that records where the shared lock was taken. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:std/shared_lock-0b/mutex_type.adoc[`mutex_type`] | The mutex type this lock manages. | xref:std/shared_lock-0b/token_type.adoc[`token_type`] | The token type used to record the shared lock. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:std/shared_lock-0b/2constructor-0c.adoc[`shared_lock`] [.small]#[constructor]# | Constructors | xref:std/shared_lock-0b/2destructor.adoc[`~shared_lock`] [.small]#[destructor]# | Releases the shared lock if it is held. | xref:std/shared_lock-0b/operator_assign-06.adoc[`operator=`] | Assignment operators | xref:std/shared_lock-0b/lock.adoc[`lock`] | Acquires the managed mutex in shared mode. | xref:std/shared_lock-0b/mutex.adoc[`mutex`] | Returns the managed mutex without releasing ownership. | xref:std/shared_lock-0b/owns_lock.adoc[`owns_lock`] | Reports whether this lock currently owns a shared lock. | xref:std/shared_lock-0b/release.adoc[`release`] | Releases ownership of the managed mutex without unlocking it. | xref:std/shared_lock-0b/swap.adoc[`swap`] | Swaps the managed mutex and token with another lock. | xref:std/shared_lock-0b/try_lock.adoc[`try_lock`] | Tries to acquire the managed mutex in shared mode without blocking. | xref:std/shared_lock-0b/try_lock_for.adoc[`try_lock_for`] | Tries to acquire the managed mutex in shared mode within a duration. | xref:std/shared_lock-0b/try_lock_until.adoc[`try_lock_until`] | Tries to acquire the managed mutex in shared mode by a deadline. | xref:std/shared_lock-0b/unlock.adoc[`unlock`] | Releases the managed shared lock. | xref:std/shared_lock-0b/2conversion.adoc[`operator bool`] | Reports whether this lock currently owns a shared lock. |=== == Template Parameters [cols="1,4"] |=== | Name| Description | *ReaderPriority* | Whether the mutex gives priority to readers. | *Tag_* | Tag type of the mutex instantiation. | *Atom* | Atomic template used by the mutex. | *Policy* | Policy type of the mutex. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#