<div dir="ltr">I mean std::recursive_mutex is recursive</div><br><div class="gmail_quote"><div dir="ltr">On Wed, May 11, 2016 at 3:01 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, eventually we should move to std::mutex and std::condition_variable, in which case it behaves as expected (std::mutex is non recursive, std::mutex is recursive).<div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, May 11, 2016 at 2:20 PM Greg Clayton via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From lldb/source/Host/windows/Mutex.cpp:<br>
<br>
<br>
Mutex::Mutex () :<br>
m_mutex()<br>
{<br>
m_mutex = static_cast<PCRITICAL_SECTION>(malloc(sizeof(CRITICAL_SECTION)));<br>
InitializeCriticalSection(static_cast<PCRITICAL_SECTION>(m_mutex));<br>
}<br>
<br>
//----------------------------------------------------------------------<br>
// Default constructor.<br>
//<br>
// Creates a pthread mutex with "type" as the mutex type.<br>
//----------------------------------------------------------------------<br>
Mutex::Mutex (Mutex::Type type) :<br>
m_mutex()<br>
{<br>
m_mutex = static_cast<PCRITICAL_SECTION>(malloc(sizeof(CRITICAL_SECTION)));<br>
InitializeCriticalSection(static_cast<PCRITICAL_SECTION>(m_mutex));<br>
}<br>
<br>
<br>
It also means that Condition.cpp doesn't act like its unix counterpart as the pthread_contition_t requires that wait be called with a non recursive mutex. Not sure what or if any issues are resulting from this, but I just thought everyone should be aware.<br>
<br>
Greg Clayton<br>
<br>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div></blockquote></div>