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.
This commit is contained in:
Bartosz Taudul 2023-04-16 17:49:21 +02:00
parent b64bab197a
commit 3b00e55235
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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();