libstdc++: std::lock_guard< _Mutex > Class Template Reference

libstdc++

std::lock_guard< _Mutex > Class Template Reference
Concurrency » Mutexes

`#include <mutex>`

## Public Types
typedef _Mutex | mutex_type

## Public Member Functions
| lock_guard (const lock_guard &)=delete
| lock_guard (mutex_type &__m)
| lock_guard (mutex_type &__m, adopt_lock_t) noexcept
lock_guard & | operator= (const lock_guard &)=delete

## Detailed Description

template<typename _Mutex>
class std::lock_guard< _Mutex >

A simple scoped lock type.

A lock_guard controls mutex ownership within a scope, releasing ownership in the destructor.

Since
  C++11

Definition at line 269 of file std_mutex.h.

## Member Typedef Documentation

## ◆ mutex_type

template<typename _Mutex>

typedef _Mutex std::lock_guard< _Mutex >::mutex_type

Definition at line 272 of file std_mutex.h.

## Constructor & Destructor Documentation

## ◆ lock_guard() [1/2]

template<typename _Mutex>

std::lock_guard< _Mutex >::lock_guard | ( | mutex_type & | __m | ) |
| inlineexplicit

Definition at line 275 of file std_mutex.h.

## ◆ lock_guard() [2/2]

template<typename _Mutex>

std::lock_guard< _Mutex >::lock_guard | ( | mutex_type & | __m,
|  | adopt_lock_t | )
| inlinenoexcept

Definition at line 279 of file std_mutex.h.

## ◆ ~lock_guard()

template<typename _Mutex>

std::lock_guard< _Mutex >::~lock_guard | ( |  | ) |
| inline

Definition at line 282 of file std_mutex.h.

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

- std_mutex.h