31 std::visit([](
auto &mutex) { mutex.lock(); },
m_variant);
34 std::visit([](
auto &mutex) { mutex.unlock(); },
m_variant);
37 return std::visit([](
auto &mutex) {
return mutex.try_lock(); },
m_variant);
41 std::variant<std::recursive_mutex, TargetAPIMutex>
m_variant;
#define LLDB_INSTRUMENT_VA(...)
Holds either a standalone std::recursive_mutex (default-constructed SBMutex, no Target to resolve thr...
std::variant< std::recursive_mutex, TargetAPIMutex > m_variant
MutexVariant(lldb::TargetSP target_sp)
bool IsValid() const
Returns true if this lock has ownership of the underlying mutex.
void unlock() const
Releases ownership of this lock.
bool try_lock() const
Tries to lock the mutex.
std::shared_ptr< MutexVariant > m_opaque_sp
const SBMutex & operator=(const SBMutex &rhs)
void lock() const
Blocking operation that takes ownership of this lock.
A Lockable handle over a Target's API mutex, returned by Target::GetAPIMutex() and backing the public...
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Target > TargetSP