SyncLockT Class

Supports the WRL infrastructure and is not intended to be used directly from your code.

Syntax

template <typename SyncTraits>
class SyncLockT;

Parameters

SyncTraits
The type that can take ownership of a resource.

Remarks

Represents a type that can take exclusive or shared ownership of a resource.

The SyncLockT class is used, for example, to help implement the SRWLock class.

Members

Public Constructors

Name Description
SyncLockT::SyncLockT Initializes a new instance of the SyncLockT class.
SyncLockT::~SyncLockT Deinitializes an instance of the SyncLockT class.

Protected Constructors

Name Description
SyncLockT::SyncLockT Initializes a new instance of the SyncLockT class.

Public Methods

Name Description
SyncLockT::IsLocked Indicates whether the current SyncLockT object owns a resource; that is, the SyncLockT object is locked.
SyncLockT::Unlock Releases control of the resource held by the current SyncLockT object, if any.

Protected Data Members

Name Description
SyncLockT::sync_ Holds the underlying resource represented by the SyncLockT class.

Inheritance Hierarchy

SyncLockT

Requirements

Header: corewrappers.h

Namespace: Microsoft::WRL::Wrappers::Details

SyncLockT::~SyncLockT

Supports the WRL infrastructure and is not intended to be used directly from your code.

~SyncLockT();

Remarks

Deinitializes an instance of the SyncLockT class.

This destructor also unlocks the current SyncLockT instance.

SyncLockT::IsLocked

Supports the WRL infrastructure and is not intended to be used directly from your code.

bool IsLocked() const;

Return Value

true if the SyncLockT object is locked; otherwise, false.

Remarks

Indicates whether the current SyncLockT object owns a resource; that is, the SyncLockT object is locked.

SyncLockT::sync_

Supports the WRL infrastructure and is not intended to be used directly from your code.

typename SyncTraits::Type sync_;

Remarks

Holds the underlying resource represented by the SyncLockT class.

SyncLockT::SyncLockT

Supports the WRL infrastructure and is not intended to be used directly from your code.

SyncLockT(
   _Inout_ SyncLockT&& other
);

explicit SyncLockT(
   typename SyncTraits::Type sync = SyncTraits::GetInvalidValue()
);

Parameters

other
An rvalue-reference to another SyncLockT object.

sync
A reference to another SyncLockWithStatusT object.

Remarks

Initializes a new instance of the SyncLockT class.

The first constructor initializes the current SyncLockT object from another SyncLockT object specified by parameter other, and then invalidates the other SyncLockT object. The second constructor is protected, and initializes the current SyncLockT object to an invalid state.

SyncLockT::Unlock

Supports the WRL infrastructure and is not intended to be used directly from your code.

void Unlock();

Remarks

Releases control of the resource held by the current SyncLockT object, if any.