mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Fix races in rpmalloc initialization.
Ensure rpmalloc_thread_initialize() int worker threads is called only after rpmalloc_initialize() was called on the main profiler thread.
This commit is contained in:
parent
cef8124247
commit
4c28593031
@ -1179,6 +1179,8 @@ void Profiler::Worker()
|
||||
s_profilerTid = syscall( SYS_gettid );
|
||||
#endif
|
||||
|
||||
while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
|
||||
rpmalloc_thread_initialize();
|
||||
|
||||
const auto procname = GetProcessName();
|
||||
@ -1187,8 +1189,6 @@ void Profiler::Worker()
|
||||
const auto hostinfo = GetHostInfo();
|
||||
const auto hisz = std::min<size_t>( strlen( hostinfo ), WelcomeMessageHostInfoSize - 1 );
|
||||
|
||||
while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
uint8_t onDemand = 1;
|
||||
#else
|
||||
@ -1517,6 +1517,7 @@ void Profiler::Worker()
|
||||
|
||||
void Profiler::CompressWorker()
|
||||
{
|
||||
while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
rpmalloc_thread_initialize();
|
||||
for(;;)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user