# WinStd: winstd::mutex_locker Class Reference

Loading...
Searching...
No Matches
winstd::mutex_locker Class Reference
Windows API

Locks given mutex in constructor and releases it in destructor. More...

`#include <WinStd/Win.h>`

## Public Member Functions

| mutex_locker (HANDLE hMutex, DWORD dwMilliseconds=INFINITE)
| Waits until the specified mutex is in the signaled state or the time-out interval elapses.
virtual | ~mutex_locker ()
| Releases ownership of the mutex object.

## Protected Attributes

HANDLE | m_h

## Detailed Description

Locks given mutex in constructor and releases it in destructor.

## Constructor & Destructor Documentation

## mutex_locker()

winstd::mutex_locker::mutex_locker | ( | HANDLE | hMutex,
|  | DWORD | dwMilliseconds = INFINITE )

inline

Waits until the specified mutex is in the signaled state or the time-out interval elapses.

Parameters

  [in] | hMutex | Mutex
  [in] | dwMilliseconds | The time-out interval, in milliseconds. If a nonzero value is specified, the function waits until the object is signaled or the interval elapses. If dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled; it always returns immediately. If dwMilliseconds is INFINITE, the function will return only when the object is signaled.

See also
  WaitForSingleObject function

## ~mutex_locker()

virtual winstd::mutex_locker::~mutex_locker | ( |  | ) |

inlinevirtual

Releases ownership of the mutex object.

See also
  ReleaseMutex function

The documentation for this class was generated from the following file:

- include/WinStd/Win.h