std::lock_guard(3)

std::lock_guard3

A simple scoped lock type.

Usage

#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

Author

Generated automatically by Doxygen for libstdc++ from the source code.

From gcc 16.2.1+r23+gd564253eb6c8-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.