Home |
RTTarget-32 Programming Manual System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) Macro RTSPINLOCK Function RTReleaseSpinlockFast |
Macro RTSPINLOCKRTSPINLOCK statically initializes a spinlock: typedef struct RTSpinlock; RTSpinlock RTSPINLOCK(DWORD Flags, const char * Name); ParametersFlagsZero or a combination of the following values. Please note that these flags are only evaluated by RTLockSpinlock and RTReleaseSpinlock. RTLockSpinlockFast and RTReleaseSpinlockFast always assume that no flags are set.
NameA string containing the name of the spinlock. Only a pointer to this string is maintained by the spinlock, so the string must not be deallocated. It is used for diagnostics purposes only. return valueThis macro returns a static spinlock structure which can be assigned to a spinlock when it is declared. Example:RTSpinlock MySpin = RTSPINLOCK(RT_SPIN_FAIL_TIMEOUT, "My Spinlock"); int main(void) { ... if (!RTLockSpinlock(&MySpin, 0)) return 1; // failed; error message was displayed already ...
|