From c877d0bcb45a9a8043c7e74b291f93d47ac2b2da Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Mon, 4 May 2026 15:45:56 -0700 Subject: [PATCH] TracySysTrace already manages the wprker thread lifetime... --- public/client/apple/TracyMach.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/public/client/apple/TracyMach.cpp b/public/client/apple/TracyMach.cpp index 84f0e9db..ea51d74c 100644 --- a/public/client/apple/TracyMach.cpp +++ b/public/client/apple/TracyMach.cpp @@ -21,7 +21,6 @@ namespace tracy static std::atomic s_traceActive { false }; static mach_timebase_info_data_t s_timebase; static int s_samplingHz; -static pthread_t s_watchdogThread; static void SysTraceEmitCallstackSample( uint32_t threadId, int64_t timestamp, const uint64_t* frames, int depth ) { @@ -205,21 +204,12 @@ bool SysTraceStart( int64_t& samplingPeriod ) mach_timebase_info( &s_timebase ); s_samplingHz = GetSamplingFrequency(); samplingPeriod = SamplingFrequencyToPeriodNs( s_samplingHz ); - auto trampoline = []( void* ) -> void* { SysTraceWorker( nullptr ); return nullptr; }; - if( pthread_create( &s_watchdogThread, nullptr, trampoline, nullptr ) != 0 ) - { - s_traceActive.store( false, std::memory_order_relaxed ); - return false; - } return true; } void SysTraceStop() { - bool expected = true; - if( !s_traceActive.compare_exchange_strong( expected, false, std::memory_order_relaxed ) ) - return; - pthread_join( s_watchdogThread, nullptr ); + s_traceActive.store( false, std::memory_order_relaxed ); } void SysTraceGetExternalName( uint64_t thread, const char*& threadName, const char*& name )