LLVM API Documentation
#include <MutexGuard.h>
Collaboration diagram for llvm::MutexGuard:
Public Member Functions | |
MutexGuard (sys::Mutex &m) | |
~MutexGuard () | |
bool | holds (const sys::Mutex &lock) const |
Instances of this class acquire a given Mutex Lock when constructed and hold that lock until destruction. The intention is to instantiate one of these on the stack at the top of some scope to be assured that C++ destruction of the object will always release the Mutex and thus avoid a host of nasty multi-threading problems in the face of exceptions, etc.
Definition at line 27 of file MutexGuard.h.
llvm::MutexGuard::MutexGuard | ( | sys::Mutex & | m | ) | [inline] |
llvm::MutexGuard::~MutexGuard | ( | ) | [inline] |
bool llvm::MutexGuard::holds | ( | const sys::Mutex & | lock | ) | const [inline] |
holds - Returns true if this locker instance holds the specified lock. This is mostly used in assertions to validate that the correct mutex is held.
Definition at line 37 of file MutexGuard.h.