[#BloombergLP-bslmt-Once-enter] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/Once.adoc[Once]::enter :relfileprefix: ../../../ :mrdocs: Lock the internal mutex using the specified `onceLock` (possibly blocking if another thread has already locked the mutex). If no other thread has yet called `enter` or `callOnce` on this object, return `true`. Otherwise, unlock the mutex and return `false`. The mutex lock may be skipped if it can be determined that it will not be needed. The behavior is undefined if `onceLock` is already in a locked state on entry to this method. Note that if `enter` returns `true`, the caller _must_ eventually call `leave`, or else other threads may block indefinitely. == Synopsis Declared in `<bslmt_once.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool enter(xref:BloombergLP/bslmt/Once/OnceLock.adoc[OnceLock]* onceLock); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#