Utility class for exception-safe mutex locking.
More...
#include <glibmm/thread.h>
Utility class for exception-safe mutex locking.
- Usage example:
{
do_something();
}
Utility class for exception-safe mutex locking.
Definition: thread.h:486
void lock()
Locks the mutex.
As you can see, the compiler takes care of the unlocking. This is not only exception safe but also much less error-prone. You could even return
while still holding the lock and it will be released properly.
- Deprecated:
- Use Glib::Threads::Mutex::Lock instead.
◆ Lock() [1/3]
Glib::Mutex::Lock::Lock |
( |
Mutex & |
mutex | ) |
|
|
inlineexplicit |
◆ Lock() [2/3]
◆ Lock() [3/3]
◆ ~Lock()
Glib::Mutex::Lock::~Lock |
( |
| ) |
|
|
inline |
◆ acquire()
void Glib::Mutex::Lock::acquire |
( |
| ) |
|
|
inline |
◆ locked()
bool Glib::Mutex::Lock::locked |
( |
| ) |
const |
|
inline |
◆ release()
void Glib::Mutex::Lock::release |
( |
| ) |
|
|
inline |
◆ try_acquire()
bool Glib::Mutex::Lock::try_acquire |
( |
| ) |
|
|
inline |