[#std-shared_lock-0b-2constructor-08] = 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 tries to acquire the mutex without blocking. == Synopsis Declared in `<folly/SharedMutex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] shared_lock( xref:std/shared_lock-0b/mutex_type.adoc[mutex_type]& mutex, std::try_to_lock_t unused); ---- == 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 try to lock. | *unused* | Tag selecting try‐to‐lock. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#