[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 11:43:01 PDT 2016


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Maybe instead of "NoLock" on the functions we those functions take an extra argument? Then someone can't accidentally run one of those without locking. We need to somehow enforce that locking must occur.  Maybe passing an extra:

  const GDBRemoteClientBase::Lock &lock

Making it const can stop people from locking it in the NoLock functions, and we can maybe assert:

  bool
  GDBRemoteCommunicationClient::SetCurrentThread(uint64_t tid, const GDBRemoteClientBase::Lock &lock)
  {
      assert(lock.IsAcquired());

Then IsAcquired() can be const, but this at least would enforce that someone needs to lock before sending the packet. We probably need to document these no locking commands and let users know they must lock and pass in the lock for verification.


https://reviews.llvm.org/D23802





More information about the lldb-commits mailing list