mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-05 12:59:15 +00:00
Hide rest of statics.
This commit is contained in:
@@ -44,7 +44,7 @@ struct ThreadNameData
|
||||
const char* name;
|
||||
ThreadNameData* next;
|
||||
};
|
||||
extern std::atomic<ThreadNameData*>& s_threadNameData;
|
||||
std::atomic<ThreadNameData*>& GetThreadNameData();
|
||||
#endif
|
||||
|
||||
void SetThreadName( std::thread& thread, const char* name )
|
||||
@@ -124,8 +124,8 @@ void SetThreadName( std::thread::native_handle_type handle, const char* name )
|
||||
data->id = (uint64_t)handle;
|
||||
# endif
|
||||
data->name = buf;
|
||||
data->next = s_threadNameData.load( std::memory_order_relaxed );
|
||||
while( !s_threadNameData.compare_exchange_weak( data->next, data, std::memory_order_release, std::memory_order_relaxed ) ) {}
|
||||
data->next = GetThreadNameData().load( std::memory_order_relaxed );
|
||||
while( !GetThreadNameData().compare_exchange_weak( data->next, data, std::memory_order_release, std::memory_order_relaxed ) ) {}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -134,7 +134,7 @@ const char* GetThreadName( uint64_t id )
|
||||
{
|
||||
static char buf[256];
|
||||
#ifdef TRACY_COLLECT_THREAD_NAMES
|
||||
auto ptr = s_threadNameData.load( std::memory_order_relaxed );
|
||||
auto ptr = GetThreadNameData().load( std::memory_order_relaxed );
|
||||
while( ptr )
|
||||
{
|
||||
if( ptr->id == id )
|
||||
|
||||
Reference in New Issue
Block a user