API for platform independent spinlock synchronization primitive.
Namespace: | dmSpinlock |
Include: | #include <dmsdk/dlib/spinlock.h> |
TYPES | |
---|---|
dmSpinlock::Spinlock | Spinlock type definition |
FUNCTIONS | |
---|---|
void dmSpinlock::Init(dmSpinlock::Spinlock* spinlock) | initalize spinlock. |
void dmSpinlock::Lock(dmSpinlock::Spinlock* spinlock) | lock spinlock. |
void dmSpinlock::Unlock(dmSpinlock::Spinlock* spinlock) | unlock spinlock. |
MACROS | |
---|---|
DM_SPINLOCK_SCOPED_LOCK(mutex) | macro for using a spinlock during a scope |
void dmSpinlock::Init(dmSpinlock::Spinlock* spinlock)
Initialize a Spinlock
PARAMETERS
dmSpinlock::Spinlock* |
spinlock |
spinlock to initialize. |
void dmSpinlock::Lock(dmSpinlock::Spinlock* spinlock)
Lock a Spinlock
PARAMETERS
dmSpinlock::Spinlock* |
spinlock |
spinlock to lock. |
void dmSpinlock::Unlock(dmSpinlock::Spinlock* spinlock)
Unlock a Spinlock
PARAMETERS
dmSpinlock::Spinlock* |
spinlock |
spinlock to unlock. |
typedef <..native type..> Spinlock;
Will lock a Spinlock and automatically unlock it at the end of the scope.
mutex |
Spinlock reference to lock. |