AcquireSRWLockShared

AcquireSRWLockShared acquires the SRW lock in shared mode. Multiple threads can hold the lock in shared mode simultaneously, allowing concurrent read access. If an exclusive lock is held, the calling thread blocks until the lock can be acquired in shared mode.

Syntax

Copy
VOID AcquireSRWLockShared(   
    PSRWLOCK pSrwLock
);

Parameters

pSrwLock

A pointer to the SRW lock to acquire.

Return Value

This function does not return a value.

Remarks

Requirements

Minimum supported version Header Library

wRTOS 1.1 SDK

windows.h

wRTOS_rtss.lib

Example

Copy
SRWLOCK lock;
InitializeSRWLock(&lock);

AcquireSRWLockShared(&lock);
// Perform read-only operations
ReleaseSRWLockShared(&lock);

See Also: