ThreadLocal: Return a mutable pointer if templated with a non-const type
[oota-llvm.git] / include / llvm / Support / MutexGuard.h
index 6bb162277e2b22118b298c34bf84ad5757e1cad6..b9f941dab3235507d74fd9a7c1daaf7d1ddaf417 100644 (file)
@@ -29,8 +29,8 @@ namespace llvm {
     MutexGuard(const MutexGuard &) LLVM_DELETED_FUNCTION;
     void operator=(const MutexGuard &) LLVM_DELETED_FUNCTION;
   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.