[#BloombergLP-bslmt-ReadLockGuard-2constructor-088] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ReadLockGuard.adoc[ReadLockGuard]::ReadLockGuard :relfileprefix: ../../../ :mrdocs: Create a guard that acquires a read lock on `lock`. == Synopsis Declared in `<bslmt_readlockguard.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit ReadLockGuard(T* lock); ---- == Description Create a scoped guard that conditionally manages the specified `lock` (if non‐null) and invokes `lock‐>lockRead()`. Supplying a null `lock` has no effect. The behavior is undefined unless `lock` (if non‐null) is not already locked by this thread. Note that `lock` must remain valid throughout the lifetime of this guard, or until `release` is called. == Parameters [cols="1,4"] |=== | Name| Description | *lock* | lock object to acquire for reading; may be null |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#