libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
MutexLock Class Reference

RAII lock guard - locks on construction, unlocks on destruction. More...

#include <Mutex.h>

Public Member Functions

 MutexLock (Mutex &m)
 Locks m until this guard goes out of scope.
 
 MutexLock (const MutexLock &)=delete
 
MutexLock & operator= (const MutexLock &)=delete
 

Protected Attributes

Mutex & mutex
 The mutex held by this guard.
 

Detailed Description

RAII lock guard - locks on construction, unlocks on destruction.

Use this instead of calling Mutex::lock()/unlock() directly wherever possible, so an early return or exception can't leave the mutex held.

Definition at line 36 of file Mutex.h.

Constructor & Destructor Documentation

◆ MutexLock()

MutexLock::MutexLock ( Mutex & m)
inlineexplicit

Locks m until this guard goes out of scope.

Definition at line 40 of file Mutex.h.

◆ ~MutexLock()

MutexLock::~MutexLock ( )
inline

Definition at line 41 of file Mutex.h.

Member Data Documentation

◆ mutex

Mutex& MutexLock::mutex
protected

The mutex held by this guard.

Definition at line 47 of file Mutex.h.


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