mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Allow direct access to ThreadNameData.
This commit is contained in:
parent
3658c0c90f
commit
5e224101c4
@ -101,13 +101,6 @@ TRACY_API uint32_t GetThreadHandleImpl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
struct ThreadNameData
|
|
||||||
{
|
|
||||||
uint32_t id;
|
|
||||||
uint32_t groupHint;
|
|
||||||
const char* name;
|
|
||||||
ThreadNameData* next;
|
|
||||||
};
|
|
||||||
std::atomic<ThreadNameData*>& GetThreadNameData();
|
std::atomic<ThreadNameData*>& GetThreadNameData();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -219,6 +212,22 @@ TRACY_API void SetThreadNameWithHint( const char* name, uint32_t groupHint )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TRACY_ENABLE
|
||||||
|
ThreadNameData* GetThreadNameData( uint32_t id )
|
||||||
|
{
|
||||||
|
auto ptr = GetThreadNameData().load( std::memory_order_relaxed );
|
||||||
|
while( ptr )
|
||||||
|
{
|
||||||
|
if( ptr->id == id )
|
||||||
|
{
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
ptr = ptr->next;
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TRACY_API const char* GetThreadName( uint32_t id )
|
TRACY_API const char* GetThreadName( uint32_t id )
|
||||||
{
|
{
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
|
@ -14,6 +14,16 @@ TRACY_API uint32_t GetThreadHandleImpl();
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
|
struct ThreadNameData
|
||||||
|
{
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t groupHint;
|
||||||
|
const char* name;
|
||||||
|
ThreadNameData* next;
|
||||||
|
};
|
||||||
|
|
||||||
|
ThreadNameData* GetThreadNameData( uint32_t id );
|
||||||
|
|
||||||
TRACY_API uint32_t GetThreadHandle();
|
TRACY_API uint32_t GetThreadHandle();
|
||||||
#else
|
#else
|
||||||
static inline uint32_t GetThreadHandle()
|
static inline uint32_t GetThreadHandle()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user