From Cppreference
|
|
|
|
|
template<typename Mutex> class lock_guard;
|
|
(C++11 feature)
|
|
|
The class lock_guard implements a strictly scope-based mutex ownership wrapper. The class is non-copyable.
The supplied Mutex type shall implement the Lockable concept.
[edit] Member types
|
Member type
|
Definition
|
|
mutex_type
|
Mutex
|
[edit] Member functions
|
|
constructs new lock_guard object and locks the given mutex (public member function)
|
|
|
destructs the lock_guard object, unlocks the underlying mutex (public member function)
|
[edit] Example