mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Add unique event identifier source.
This commit is contained in:
@@ -20,6 +20,7 @@ static Profiler* s_instance = nullptr;
|
||||
|
||||
Profiler::Profiler()
|
||||
: m_shutdown( false )
|
||||
, m_id( 0 )
|
||||
{
|
||||
assert( PointerCheckA == PointerCheckB );
|
||||
assert( !s_instance );
|
||||
@@ -38,6 +39,11 @@ Profiler::~Profiler()
|
||||
m_thread.join();
|
||||
}
|
||||
|
||||
uint64_t Profiler::GetNewId()
|
||||
{
|
||||
return s_instance->m_id.fetch_add( 1, std::memory_order_relaxed );
|
||||
}
|
||||
|
||||
void Profiler::Worker()
|
||||
{
|
||||
for(;;)
|
||||
|
||||
Reference in New Issue
Block a user