ReleaseSRWLockExclusive
ReleaseSRWLockExclusive releases an SRW lock previously acquired in exclusive mode. If other threads are waiting, the next waiter is awakened according to the queuing policy.
Syntax
VOID ReleaseSRWLockExclusive(
PSRWLOCK pSrwLock
);
Parameters
pSrwLock
A pointer to the SRW lock to release.
Return Value
This function does not return a value.
Remarks
- This function must be called by the thread that acquired the lock in exclusive mode.
- This function wakes waiting threads in FIFO order.
- This function raises EXCEPTION_POSSIBLE_DEADLOCK if:
- The lock is not owned.
- The lock is owned in shared mode (incorrect release function).
- This function raises EXCEPTION_ACCESS_VIOLATION if pSrwLock is NULL.
Requirements
| Minimum supported version | Header | Library |
|---|---|---|
|
wRTOS 1.1 SDK |
windows.h |
wRTOS_rtss.lib |
Example
AcquireSRWLockExclusive(&lock);
// Code that is executed by only one thread at a time when using the lock this way.
ReleaseSRWLockExclusive(&lock);
See Also: