[Lldb-commits] [PATCH] D23802: gdb-remote: Make the sequence mutex non-recursive

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 23 09:18:04 PDT 2016


clayborg added a comment.

The old mutex was there so that you could send a packet and get a result without worrying about other threads getting your response. It was recursive for the case where we needed to send two packets as one (set thread ID, then send packet), and for reading all registers (as you have found), so your patch does work, but it now only for these special cases. Now there is no way to easily take the mutex and send 5 different packets without going and adding new NoLock variants of each call that you might want to send as a single stream of packets. Can we think slightly cleaner way to do this? Before you could stake the sequence mutex in your main function that wanted to make N calls, and each call would then recursively lock the mutex and everything just worked. Now you will deadlock if you do things incorrectly (granted you will need to do a "GDBRemoteClientBase::Lock lock(gdb_comm, false);" followed by a "m_gdb_comm.SendSomePacket()".


https://reviews.llvm.org/D23802





More information about the lldb-commits mailing list