diff --git a/lldb/include/lldb/Utility/ReproducerInstrumentation.h b/lldb/include/lldb/Utility/ReproducerInstrumentation.h --- a/lldb/include/lldb/Utility/ReproducerInstrumentation.h +++ b/lldb/include/lldb/Utility/ReproducerInstrumentation.h @@ -868,17 +868,14 @@ /// Mark the current thread as a private thread and pretend that everything /// on this thread is behind happening behind the API boundary. - static void PrivateThread() { g_global_boundary = true; } + static void PrivateThread(); private: static unsigned GetNextSequenceNumber() { return g_sequence++; } unsigned GetSequenceNumber() const; template friend struct replay; - void UpdateBoundary() { - if (m_local_boundary) - g_global_boundary = false; - } + void UpdateBoundary(); #ifdef LLDB_REPRO_INSTR_TRACE void Log(unsigned id) { @@ -902,9 +899,6 @@ /// The sequence number for this pair of function and result. unsigned m_sequence; - /// Whether we're currently across the API boundary. - static thread_local bool g_global_boundary; - /// Global mutex to protect concurrent access. static std::mutex g_mutex; diff --git a/lldb/source/Utility/ReproducerInstrumentation.cpp b/lldb/source/Utility/ReproducerInstrumentation.cpp --- a/lldb/source/Utility/ReproducerInstrumentation.cpp +++ b/lldb/source/Utility/ReproducerInstrumentation.cpp @@ -16,6 +16,9 @@ using namespace lldb_private; using namespace lldb_private::repro; +// Whether we're currently across the API boundary. +static thread_local bool g_global_boundary = false; + void *IndexToObject::GetObjectForIndexImpl(unsigned idx) { return m_mapping.lookup(idx); } @@ -227,6 +230,13 @@ return m_sequence; } +void Recorder::PrivateThread() { g_global_boundary = true; } + +void Recorder::UpdateBoundary() { + if (m_local_boundary) + g_global_boundary = false; +} + void InstrumentationData::Initialize(Serializer &serializer, Registry ®istry) { InstanceImpl().emplace(serializer, registry); @@ -248,6 +258,5 @@ return g_instrumentation_data; } -thread_local bool lldb_private::repro::Recorder::g_global_boundary = false; std::atomic lldb_private::repro::Recorder::g_sequence; std::mutex lldb_private::repro::Recorder::g_mutex;