================ @@ -1692,6 +1692,20 @@ class Target : public std::enable_shared_from_this<Target>, } }; +/// The private implementation backing SBLock. +struct APILock { + APILock(std::recursive_mutex &mutex) : lock(mutex) {} + std::lock_guard<std::recursive_mutex> lock; +}; + +/// The private implementation used by SBLock to hand out the target API mutex. +/// It has a TargetSP to ensure the lock cannot outlive the target. +struct TargetAPILock : public APILock { ---------------- labath wrote:
I don't think that's true. The overload (number 8 in the cppreference page) which takes a rvalue reference is a c++20 thing, but the version which takes a `const&` has been around since forever. I'm pretty sure of that because we're [already using](https://github.com/llvm/llvm-project/blob/1f844952558b041ff1b4c27eed7b81c15841ee84/lldb/include/lldb/Utility/SharedCluster.h#L48) this functionality. https://github.com/llvm/llvm-project/pull/131404 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits