Edit

Share via


SyncLockWithStatusT Class

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

Syntax

template <typename SyncTraits>
class SyncLockWithStatusT : public SyncLockT<SyncTraits>;

Parameters

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

Remarks

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

The SyncLockWithStatusT class is used to implement the Mutex and Semaphore classes.

Members

Public Constructors

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

Protected Constructors

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

Public Methods

Name Description
SyncLockWithStatusT::GetStatus Retrieves the wait status of the current SyncLockWithStatusT object.
SyncLockWithStatusT::IsLocked Indicates whether the current SyncLockWithStatusT object owns a resource; that is, the SyncLockWithStatusT object is locked.

Protected Data Members

Name Description
SyncLockWithStatusT::status_ Holds the result of the underlying wait operation after a lock operation on an object based on the current SyncLockWithStatusT object.

Inheritance Hierarchy

SyncLockT

SyncLockWithStatusT

Requirements

Header: corewrappers.h

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

SyncLockWithStatusT::GetStatus

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

DWORD GetStatus() const;

Return Value

The result of a wait operation on the object that is based on the SyncLockWithStatusT class, such as a Mutex or Semaphore. Zero (0) indicates the wait operation returned the signaled state; otherwise, another state occurred, such as time-out value elapsed.

Remarks

Retrieves the wait status of the current SyncLockWithStatusT object.

The GetStatus() function retrieves the value of the underlying status_ data member. When an object based on the SyncLockWithStatusT class performs a lock operation, the object first waits for the object to become available. The result of that wait operation is stored in the status_ data member. The possible values of the status_ data member are the return values of the wait operation. For more information, see the return values of the WaitForSingleObjectEx function.

SyncLockWithStatusT::IsLocked

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

bool IsLocked() const;

Remarks

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

Return Value

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

SyncLockWithStatusT::status_

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

DWORD status_;

Remarks

Holds the result of the underlying wait operation after a lock operation on an object based on the current SyncLockWithStatusT object.

SyncLockWithStatusT::SyncLockWithStatusT

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

SyncLockWithStatusT(
   _Inout_ SyncLockWithStatusT&& other
);

explicit SyncLockWithStatusT(
   typename SyncTraits::Type sync,
   DWORD status
);

Parameters

other
An rvalue-reference to another SyncLockWithStatusT object.

sync
A reference to another SyncLockWithStatusT object.

status
The value of the status_ data member of the other parameter or the sync parameter.

Remarks

Initializes a new instance of the SyncLockWithStatusT class.

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