[#BloombergLP-bsls-SpinLock-lockWithBackoff]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/SpinLock.adoc[SpinLock]::lockWithBackoff
:relfileprefix: ../../../
:mrdocs:

Repeat a loop continuously, potentially using the system to pause or reschedule the thread, until this object is unlocked, then atomically acquire the lock&period; The spinning has backoff logic&period; Note that this method is recommended when system calls are permissible, significant contention is expected, and no better mutual exclusion primitive is available&period;

== Synopsis

Declared in `&lt;bsls&lowbar;spinlock&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
lockWithBackoff();
----


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