Glib::Mutex::Lock Class Reference
[Threads]
Utility class for exception-safe mutex locking. More...
List of all members.
Detailed Description
Utility class for exception-safe mutex locking.
- Usage example:
- 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.
- Examples:
-
thread/thread.cc.
Constructor & Destructor Documentation
Glib::Mutex::Lock::Lock |
( |
Mutex& |
mutex |
) |
[inline, explicit] |
Glib::Mutex::Lock::~Lock |
( |
|
) |
[inline] |
Member Function Documentation
void Glib::Mutex::Lock::acquire |
( |
|
) |
[inline] |
bool Glib::Mutex::Lock::locked |
( |
|
) |
const [inline] |
void Glib::Mutex::Lock::release |
( |
|
) |
[inline] |
bool Glib::Mutex::Lock::try_acquire |
( |
|
) |
[inline] |
The documentation for this class was generated from the following file: