[#BloombergLP-bsls-BslLockImpl_pthread-lock] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/BslLockImpl_pthread.adoc[BslLockImpl_pthread]::lock :relfileprefix: ../../../ :mrdocs: Acquire the lock on this object. == Synopsis Declared in `<bsls_bsllockimpl_pthread.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void lock(); ---- == Description If the lock on this object is currently held by another thread, then suspend execution of the calling thread until the lock can be acquired. The behavior is undefined unless the calling thread does not already hold the lock on this object. Note that deadlock may result if this method is invoked while the calling thread holds the lock on the object. [.small]#Created with https://www.mrdocs.com[MrDocs]#