[#std-shared_lock-0b-2constructor-0d] = xref:std.adoc[std]::xref:std/shared_lock-0b.adoc[shared_lock<folly::SharedMutexImpl<ReaderPriority, Tag_, Atom, Policy>>]::shared_lock :relfileprefix: ../../ :mrdocs: Constructs a lock and acquires the mutex in shared mode. == Synopsis Declared in `<folly/SharedMutex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] explicit shared_lock(xref:std/shared_lock-0b/mutex_type.adoc[mutex_type]& mutex); ---- == Return Value [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *mutex* | Mutex to lock. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#