Index: lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h =================================================================== --- lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h +++ lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h @@ -131,7 +131,7 @@ lldb::IOObjectSP m_io_sp; Pipe m_pipe; - std::recursive_mutex m_mutex; + mutable std::recursive_mutex m_mutex; std::atomic m_shutting_down; // This marks that we are shutting down so // if we get woken up from // BytesAvailable to disconnect, we won't try to read again. Index: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp =================================================================== --- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -118,6 +118,7 @@ } bool ConnectionFileDescriptor::IsConnected() const { + std::lock_guard guard(m_mutex); return m_io_sp && m_io_sp->IsValid(); }