<p>
This is a lock designed to protect VERY short sections of critical code.
Threads attempting to take the lock will wait until the lock is available,
thus it is important that the code protected by this lock is extremely simple
and non blocking.
</p>
<pre>
try (SpinLock.Lock lock = locker.lock()) {
// something very quick and non blocking
}
</pre>
<p> This is a lock designed to protect VERY short sections of critical code. Threads attempting to take the lock will wait until the lock is available, thus it is important that the code protected by this lock is extremely simple and non blocking. </p>
<pre> try (SpinLock.Lock lock = locker.lock()) { // something very quick and non blocking } </pre>