<div dir="ltr">I have some patches up to LLVM currently to replace their base mutex implementations with std::mutex and std::recursive_mutex.  Assuming those go through, the next logical step would be to replace LLDB's mutex implementation with llvm::Mutex.  <div>
<br></div><div>I've had a look through the code, and the biggest feature that will be difficult to reproduce under this implementation is that of logging specific error messages from the pthread_mutex functions.  STL's implementation of course uses C++ exceptions, which both LLDB and LLVM disable at compile time.  In general, I don't expect that this will be very problematic, because errors to lock and unlock typically indicate an invalid use of the mutex, which shoudl be caught during development time, and errors to try_lock() are almost always "the mutex was already locked', in which case you only need a bool.</div>
<div><br></div><div>Before I go down this path, I want to find out if anyone has urgent need of this logging information in a way that is not upstreamable into LLVM, or if they can think of any other reasons I should not attempt this.  </div>
<div><br></div><div>In general though, I think it would be a good idea to move more common stuff down to LLVM and make use of it there, whenever possible.</div></div>