InitializeSRWLock
InitializeSRWLock initializes an SRW lock to an unlocked, uncontended state. This function must be called before any other SRW lock operations.
Syntax
VOID InitializeSRWLock(
PSRWLOCK pSrwLock
);
Parameters
pSrwLock
A pointer to the SRWLOCK structure.
Return Value
This function does not return a value.
Remarks
- This function is not thread-safe and should be called during initialization before the lock is used by multiple threads.
- Raises EXCEPTION_ACCESS_VIOLATION if pSrwLock is NULL.
- The lock is zeroed, resulting in an unlocked, uncontested state.
Requirements
| Minimum supported version | Header | Library |
|---|---|---|
|
wRTOS 1.1 SDK |
windows.h |
wRTOS_rtss.lib |
Example
SRWLOCK lock;
InitializeSRWLock(&lock);
See Also: