Share via


Mutex::Lock Method

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Mutex::Lock Method.

Waits until the current object, or the Mutex object associated with the specified handle, releases the mutex or the specified time-out interval has elapsed.

Syntax

SyncLock Lock(  
   DWORD milliseconds = INFINITE  
);  
  
static SyncLock Lock(  
   HANDLE h,  
   DWORD milliseconds = INFINITE  
);  

Parameters

milliseconds
The time-out interval, in milliseconds. The default value is INFINITE, which waits indefinitely.

h
The handle of a Mutex object.

Return Value

Requirements

Header: corewrappers.h

Namespace: Microsoft::WRL::Wrappers

See Also

Mutex Class