Support Forum G3D Web Page |
A mutual exclusion lock that busy-waits when locking. More...
Public Member Functions | |
Spinlock () | |
void | lock () |
Busy waits until the lock is unlocked, then locks it exclusively. More... | |
void | unlock () |
A mutual exclusion lock that busy-waits when locking.
On a machine with one (significant) thread per processor core, a Spinlock may be substantially faster than a mutex.
|
inline |
|
inline |
Busy waits until the lock is unlocked, then locks it exclusively.
A single thread cannot re-enter Spinlock::lock() if already locked.
Referenced by G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::clear(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::popBack(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::popFront(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::pushBack(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::pushFront(), and G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::size().
|
inline |
Referenced by G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::clear(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::popBack(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::popFront(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::pushBack(), G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::pushFront(), and G3D::ThreadsafeQueue< G3D::_internal::NetworkCallbackInfo >::size().