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

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 RTX64 4.5.5
Header windows.h
Library Rtx_Rtss.lib

Example

Copy
SRWLOCK lock;
InitializeSRWLock(&lock);

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

See Also: