[lldb-dev] All windows Mutex objects are recursive???

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Wed May 11 14:20:20 PDT 2016


From lldb/source/Host/windows/Mutex.cpp:


Mutex::Mutex () :
    m_mutex()
{
    m_mutex = static_cast<PCRITICAL_SECTION>(malloc(sizeof(CRITICAL_SECTION)));
    InitializeCriticalSection(static_cast<PCRITICAL_SECTION>(m_mutex));
}

//----------------------------------------------------------------------
// Default constructor.
//
// Creates a pthread mutex with "type" as the mutex type.
//----------------------------------------------------------------------
Mutex::Mutex (Mutex::Type type) :
    m_mutex()
{
    m_mutex = static_cast<PCRITICAL_SECTION>(malloc(sizeof(CRITICAL_SECTION)));
    InitializeCriticalSection(static_cast<PCRITICAL_SECTION>(m_mutex));
}


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.

Greg Clayton



More information about the lldb-dev mailing list