| title | SyncLockWithStatusT Class | Microsoft Docs | |||||
|---|---|---|---|---|---|---|
| ms.custom | ||||||
| ms.date | 10/03/2018 | |||||
| ms.technology |
|
|||||
| ms.topic | reference | |||||
| f1_keywords |
|
|||||
| dev_langs |
|
|||||
| helpviewer_keywords |
|
|||||
| ms.assetid | 4832fd93-0ac8-4168-9404-b43fefea7476 | |||||
| author | mikeblome | |||||
| ms.author | mblome | |||||
| ms.workload |
|
Supports the WRL infrastructure and is not intended to be used directly from your code.
template <typename SyncTraits>
class SyncLockWithStatusT : public SyncLockT<SyncTraits>;SyncTraits
A type that can take exclusive or shared ownership of a resource.
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.
| Name | Description |
|---|---|
| SyncLockWithStatusT::SyncLockWithStatusT | Initializes a new instance of the SyncLockWithStatusT class. |
| Name | Description |
|---|---|
| SyncLockWithStatusT::SyncLockWithStatusT | Initializes a new instance of the SyncLockWithStatusT class. |
| 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. |
| 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. |
SyncLockT
SyncLockWithStatusT
Header: corewrappers.h
Namespace: Microsoft::WRL::Wrappers::Details
Supports the WRL infrastructure and is not intended to be used directly from your code.
DWORD GetStatus() const;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.
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 in the MSDN Library.
Supports the WRL infrastructure and is not intended to be used directly from your code.
bool IsLocked() const;Indicates whether the current SyncLockWithStatusT object owns a resource; that is, the SyncLockWithStatusT object is locked.
true if the SyncLockWithStatusT object is locked; otherwise, false.
Supports the WRL infrastructure and is not intended to be used directly from your code.
DWORD status_;Holds the result of the underlying wait operation after a lock operation on an object based on the current SyncLockWithStatusT object.
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
);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.
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.