Delen via


lock_guard Class

Represents a template that can be instantiated to create an object whose destructor unlocks a mutex.

template<class Mutex>
class lock_guard;

Remarks

The template argument Mutex must name a mutex type.

Members

Public Typedefs

Name

Description

lock_guard::mutex_type

Synonym for the template argument Mutex.

Public Constructors

Name

Description

lock_guard::lock_guard Constructor

Constructs a lock_guard object.

lock_guard::~lock_guard Destructor

Unlocks the mutex that was passed to the constructor.

Requirements

Header: mutex

Namespace: std

See Also

Reference

<mutex>

Other Resources

C++ Standard Library Header Files