This patch picks up where https://reviews.llvm.org/D157159 left of, but
allows for concurrent reads/writes, but protects setting up and tearing
down the underlying Connection object.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/include/lldb/Core/Communication.h | ||
---|---|---|
86–90 | This isn't necessarily introduced by your patch, but I don't think this lock does much other than make sure nobody can change m_connection_sp in between you calling GetConnection and you actually receiving the Connection pointer. It still comes with all the pitfalls of handing out a raw pointer (instead of a shared_ptr). As a follow-up or maybe even precursor, we should probably stop handing out the raw connection pointer... |
lldb/include/lldb/Core/Communication.h | ||
---|---|---|
172–175 | Why do we need both? Can't we use m_connection_mutex in write mode instead of m_write_mutex? |
This isn't necessarily introduced by your patch, but I don't think this lock does much other than make sure nobody can change m_connection_sp in between you calling GetConnection and you actually receiving the Connection pointer. It still comes with all the pitfalls of handing out a raw pointer (instead of a shared_ptr).
As a follow-up or maybe even precursor, we should probably stop handing out the raw connection pointer...