ReleaseSRWLockShared
ReleaseSRWLockShared releases an SRW lock previously acquired in shared mode. If other threads are waiting, the next waiter is awakened according to the queuing policy.
Syntax
VOID ReleaseSRWLockShared(
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 a thread that acquired the lock in shared mode.
- This function decrements the shared reference count.
- When the last shared holder releases, exclusive waiters are awakened.
- This function raises EXCEPTION_POSSIBLE_DEADLOCK if the lock is not in shared mode.
- 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
AcquireSRWLockShared(&lock);
// Read-only operations
ReleaseSRWLockShared(&lock);
See Also: