From 3b00e55235919212ba358eb36423940e539e33ce Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 16 Apr 2023 17:49:21 +0200 Subject: [PATCH] Rename IsThreadStringRetrieved -> IsFailureThreadStringRetrieved. IsThreadStringRetrieved() interface suggested that it can be used for checking any thread state, as it had an uint64_t id parameter. The implementation ignored this parameter and checked the status of failure thread only. This was never an issue because the code using this function was only checking for the failure thread state. Fixed by renaming the function to explicitly state what it does and removing the thread id parameter. --- server/TracyWorker.cpp | 4 ++-- server/TracyWorker.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index f0004d3c..e165912d 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2926,7 +2926,7 @@ void Worker::UpdateMbps( int64_t td ) m_mbpsData.transferred += bytes; } -bool Worker::IsThreadStringRetrieved( uint64_t id ) +bool Worker::IsFailureThreadStringRetrieved() { const auto name = GetThreadName( m_failureData.thread ); return strcmp( name, "???" ) != 0; @@ -2953,7 +2953,7 @@ bool Worker::IsSourceLocationRetrieved( int16_t srcloc ) bool Worker::HasAllFailureData() { - if( m_failureData.thread != 0 && !IsThreadStringRetrieved( m_failureData.thread ) ) return false; + if( m_failureData.thread != 0 && !IsFailureThreadStringRetrieved() ) return false; if( m_failureData.srcloc != 0 && !IsSourceLocationRetrieved( m_failureData.srcloc ) ) return false; if( m_failureData.callstack != 0 && !IsCallstackRetrieved( m_failureData.callstack ) ) return false; return true; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 85897f48..2758f6d0 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -882,7 +882,7 @@ private: void HandlePostponedSamples(); void HandlePostponedGhostZones(); - bool IsThreadStringRetrieved( uint64_t id ); + bool IsFailureThreadStringRetrieved(); bool IsSourceLocationRetrieved( int16_t srcloc ); bool IsCallstackRetrieved( uint32_t callstack ); bool HasAllFailureData();