Share via


SRWLock Class

 

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 Class.

Represents a slim reader/writer lock.

Syntax

class SRWLock;  

Remarks

A slim reader/writer lock is used to synchronize access across threads to an object or resource. For more information, see Synchronization Functions in the MSDN Library.

Members

Public Typedefs

SyncLockExclusive Synonym for an SRWLock object that is acquired in exclusive mode.
SyncLockShared Synonym for an SRWLock object that is acquired in shared mode.

Public Constructors

Name Description
SRWLock::SRWLock Constructor Initializes a new instance of the SRWLock class.
SRWLock::~SRWLock Destructor Deinitializes an instance of the SRWLock class.

Public Methods

Name Description
SRWLock::LockExclusive Method Acquires an SRWLock object in exclusive mode.
SRWLock::LockShared Method Acquires an SRWLock object in shared mode.
SRWLock::TryLockExclusive Method Attempts to acquire a SRWLock object in exclusive mode for the current or specified SRWLock object.
SRWLock::TryLockShared Method Attempts to acquire a SRWLock object in shared mode for the current or specified SRWLock object.

Protected Data Member

Name Description
SRWLock::SRWLock_ Data Member Contains the underlying lock variable for the current SRWLock object.

Inheritance Hierarchy

SRWLock

Requirements

Header: corewrappers.h

Namespace: Microsoft::WRL::Wrappers

See Also

Microsoft::WRL::Wrappers Namespace