Fix PR 23525 - Separate header mass propagation in irregular loops.
[oota-llvm.git] / include / llvm / Support / MutexGuard.h
index 723794177c3075573ae43c4d4bcee181fd4615b7..07b64b611960448871b28f85c212f0f2a14ba05c 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef LLVM_SUPPORT_MUTEXGUARD_H
 #define LLVM_SUPPORT_MUTEXGUARD_H
 
-#include <llvm/System/Mutex.h>
+#include "llvm/Support/Mutex.h"
 
 namespace llvm {
   /// Instances of this class acquire a given Mutex Lock when constructed and
@@ -26,11 +26,11 @@ namespace llvm {
   /// @brief Guard a section of code with a Mutex.
   class MutexGuard {
     sys::Mutex &M;
-    MutexGuard(const MutexGuard &);    // DO NOT IMPLEMENT
-    void operator=(const MutexGuard &); // DO NOT IMPLEMENT
+    MutexGuard(const MutexGuard &) = delete;
+    void operator=(const MutexGuard &) = delete;
   public:
-    MutexGuard(sys::Mutex &m) : M(m) { M.acquire(); }
-    ~MutexGuard() { M.release(); }
+    MutexGuard(sys::Mutex &m) : M(m) { M.lock(); }
+    ~MutexGuard() { M.unlock(); }
     /// 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.