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

Copy
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 Header Library

wRTOS 1.1 SDK

windows.h

wRTOS_rtss.lib

Example

Copy
SRWLOCK lock;
InitializeSRWLock(&lock);

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

See Also: