AcquireSRWLockExclusive

AcquireSRWLockExclusive acquires the SRW lock in exclusive mode. Only one thread can hold the lock in exclusive mode at a time. If the lock is already held (in either shared or exclusive mode), the calling thread blocks until the lock can be acquired.

Syntax

VOID AcquireSRWLockExclusive(   
    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);

AcquireSRWLockExclusive(&lock);
// Perform exclusive write operations
ReleaseSRWLockExclusive(&lock);

See Also: