From a5bff2f7e51302ec361c21c9d285cbbd70d8f7ac Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 14 Apr 2020 22:43:23 +0200 Subject: [PATCH] Sleep to force rescheduling main thread during init. This fixes problems with first context switch data region possibly not being available for the main thread, if no rescheduling was performed after sys tracing has started. --- client/TracyProfiler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index d2bb5911..cbee564c 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1091,6 +1091,7 @@ Profiler::Profiler() { s_sysTraceThread = (Thread*)tracy_malloc( sizeof( Thread ) ); new(s_sysTraceThread) Thread( SysTraceWorker, nullptr ); + std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) ); } #endif