Edit

Share via


CriticalSectionTraits Structure

Specializes a CriticalSection object to support either an invalid critical section or a function to release a critical section.

Syntax

struct CriticalSectionTraits;

Members

Public Typedefs

Name Description
Type A typedef that defines a pointer to a critical section. Type is defined as typedef CRITICAL_SECTION* Type;.

Public Methods

Name Description
CriticalSectionTraits::GetInvalidValue Specializes a CriticalSection template so that the template is always invalid.
CriticalSectionTraits::Unlock Specializes a CriticalSection template so that it supports releasing ownership of the specified critical section object.

Inheritance Hierarchy

CriticalSectionTraits

Requirements

Header: corewrappers.h

Namespace: Microsoft::WRL::Wrappers::HandleTraits

CriticalSectionTraits::GetInvalidValue

Specializes a CriticalSection template so that the template is always invalid.

inline static Type GetInvalidValue();

Return Value

Always returns a pointer to an invalid critical section.

Remarks

The Type modifier is defined as typedef CRITICAL_SECTION* Type;.

CriticalSectionTraits::Unlock

Specializes a CriticalSection template so that it supports releasing ownership of the specified critical section object.

inline static void Unlock(
   _In_ Type cs
);

Parameters

cs
A pointer to a critical section object.

Remarks

The Type modifier is defined as typedef CRITICAL_SECTION* Type;.

For more information, see LeaveCriticalSection function in the Synchronization Functions section of the Windows API documentation.