mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-26 21:18:22 +00:00
ELF init_priority only orders constructors within a single module. All of a shared object's initializers run before any of the executable's, so an instrumented dependency .so emitting a zone from its static initializer creates the main thread producer token against the zero-initialized s_queue. The queue constructor then resets the producer list, orphaning that producer: every zone emitted on the main thread from that point on is enqueued into blocks no consumer ever iterates and silently lost, while sampling (worker thread producer) keeps working. Re-link such a producer right after the queue is constructed. In the common case, where nothing was emitted during shared object init, this merely constructs the main thread token eagerly.