[#std-shared_lock-0b-try_lock_for]
= xref:std.adoc[std]::xref:std/shared_lock-0b.adoc[shared&lowbar;lock&lt;folly::SharedMutexImpl&lt;ReaderPriority, Tag&lowbar;, Atom, Policy&gt;&gt;]::try&lowbar;lock&lowbar;for
:relfileprefix: ../../
:mrdocs:

Tries to acquire the managed mutex in shared mode within a duration&period;

== Synopsis

Declared in `&lt;folly&sol;SharedMutex&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Rep,
    typename Period&gt;
bool
try&lowbar;lock&lowbar;for(std::chrono::duration&lt;Rep, Period&gt; const& timeout);
----

== Return Value

`true` if the lock was acquired before the duration elapsed&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *timeout*
| Maximum time to wait for the lock&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
