Share via


CriticalSection::Lock Method

Waits for ownership of the specified critical section object. The function returns when the calling thread is granted ownership.

SyncLock Lock();

   static SyncLock Lock(
   _In_ CRITICAL_SECTION* cs
);

Parameters

  • cs
    A user-specified critical section object.

Return Value

A lock object that can be used to unlock the current critical section.

Remarks

The first Lock function affects the current critical section object. The second Lock function affects a user-specified critical section.

Requirements

Header: corewrappers.h

Namespace: Microsoft::WRL::Wrappers

See Also

Reference

CriticalSection Class