[Lldb-commits] [lldb] [lldb] Expose the Target API mutex through the SB API (PR #133295)
Alex Langford via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 27 15:25:32 PDT 2025
================
@@ -0,0 +1,59 @@
+//===-- SBMutex.cpp
+//--------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/API/SBMutex.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Utility/Instrumentation.h"
+#include "lldb/lldb-forward.h"
+#include <memory>
+#include <mutex>
+
+using namespace lldb;
+using namespace lldb_private;
+
+SBMutex::SBMutex() { LLDB_INSTRUMENT_VA(this); }
+
+SBMutex::SBMutex(const SBMutex &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
+ LLDB_INSTRUMENT_VA(this);
+}
+
+const SBMutex &SBMutex::operator=(const SBMutex &rhs) {
+ LLDB_INSTRUMENT_VA(this);
+
+ m_opaque_sp = rhs.m_opaque_sp;
+ return *this;
+}
+
+SBMutex::SBMutex(lldb::TargetSP target_sp)
+ : m_opaque_sp(std::shared_ptr<std::recursive_mutex>(
----------------
bulbazord wrote:
This doesn't look like it builds the shared_ptr?
https://github.com/llvm/llvm-project/pull/133295
More information about the lldb-commits
mailing list