[Lldb-commits] [PATCH] D20351: second pass over removal of Mutex and Condition

Saleem Abdulrasool via lldb-commits lldb-commits at lists.llvm.org
Wed May 18 18:19:24 PDT 2016


compnerd marked 2 inline comments as done.

================
Comment at: source/Interpreter/CommandObject.cpp:339
@@ -338,3 +338,3 @@
     m_exe_ctx.Clear();
-    m_api_locker.Unlock();
+    m_api_locker.unlock();
 }
----------------
zturner wrote:
> ```
> if (m_api_locker)
>     m_api_locker.unlock();
> ```
> 
> Otherwise this is undefined behavior.  Also make sure you do this check anywhere else in the patch where you do manual unlocking / locking like this.
Yeah, this was the only place where the lock was unlocked and there wasn't a comment indicating that the assumption was that the lock will be held.  A few places where there were unlocks were early releases of the unique_lock.  A couple of places indicated that the lock must have been acquired prior to the destructor running.


Repository:
  rL LLVM

http://reviews.llvm.org/D20351





More information about the lldb-commits mailing list