- /// MutexLocker - Instances of this class acquire a given Lock when
- /// constructed and hold that lock until destruction.
- ///
- class MutexLocker {
- Mutex &M;
- MutexLocker(const MutexLocker &); // DO NOT IMPLEMENT
- void operator=(const MutexLocker &); // DO NOT IMPLEMENT
+ /// 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.
+ /// @brief Guard a section of code with a Mutex.
+ class MutexGuard {
+ sys::Mutex &M;
+ MutexGuard(const MutexGuard &) LLVM_DELETED_FUNCTION;
+ void operator=(const MutexGuard &) LLVM_DELETED_FUNCTION;