mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Don't report CPU topology if delayed init is active.
Reporting topology requires producer to be available, which creates a deadlock during delayed init data structures construction. Calling GetProducer() results in a call to GetProfilerThreadData(), which in turn calls GetProfilerData() to construct its thread local variable. However, at this point we already are calling GetProfilerData() (to construct the profiler itself). This would result in an incorrect double construction of data, but the code already prevents this by allowing init code to be entered only once. Hence the deadlock. Currently this is a non-issue, as no platform which can report CPU topology needs to use delayed init.
This commit is contained in:
parent
d272e19bfa
commit
25082b2bec
@ -2450,6 +2450,7 @@ void Profiler::CalibrateDelay()
|
||||
|
||||
void Profiler::ReportTopology()
|
||||
{
|
||||
#ifndef TRACY_DELAYED_INIT
|
||||
struct CpuData
|
||||
{
|
||||
uint32_t package;
|
||||
@ -2592,6 +2593,7 @@ void Profiler::ReportTopology()
|
||||
|
||||
tracy_free( cpuData );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Profiler::SendCallstack( int depth, const char* skipBefore )
|
||||
|
Loading…
Reference in New Issue
Block a user