1
0
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:
Bartosz Taudul
2017-09-10 20:08:42 +02:00
parent e4356eb67e
commit 05486c8225
2 changed files with 10 additions and 0 deletions
+6
View File
@@ -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(;;)