[#std-shared_lock-0b-owns_lock] = xref:std.adoc[std]::xref:std/shared_lock-0b.adoc[shared_lock<folly::SharedMutexImpl<ReaderPriority, Tag_, Atom, Policy>>]::owns_lock :relfileprefix: ../../ :mrdocs: Reports whether this lock currently owns a shared lock. == Synopsis Declared in `<folly/SharedMutex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool owns_lock() const noexcept; ---- == Return Value `true` if a shared lock is held. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== [.small]#Created with https://www.mrdocs.com[MrDocs]#