Share via


SRWLock::TryLockExclusive Method

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at SRWLock::TryLockExclusive Method.

Attempts to acquire a SRWLock object in exclusive mode for the current or specified SRWLock object. If the call is successful, the calling thread takes ownership of the lock.

Syntax

SyncLockExclusive TryLockExclusive();  
  
static SyncLockExclusive TryLockExclusive(  
   _In_ SRWLOCK* lock  
);  

Parameters

lock
Pointer to an SRWLock object.

Return Value

If successful, an SRWLock object in exclusive mode and the calling thread takes ownership of the lock. Otherwise, an SRWLock object whose state is invalid.

Requirements

Header: corewrappers.h

Namespace: Microsoft::WRL::Wrappers

See Also

SRWLock Class