zig-tracy
zig-tracy copied to clipboard
Add tracing mutex support
As announced in #10, here is my implementation of lockables in the form of mutexes. I decided it would be nicest to wrap the Tracy API in a TracingMutex struct (much like TracingAllocator). This mimicks the intended use of lockables in Tracy for C++ in an idiomatic Zig way.
- Implement TracingMutex, wiring Tracy lockable contexts for lock/tryLock/unlock with source metadata.
- Announce and customize lockables, emit lock/unlock markers, and ensure proper cleanup.
- Added a helper function
getSrcLoc(..)to re-use source location trick and clean up the flow of code. - Refactored examples into an
examples/folder for nicer organization of multiple examples (decided to split the mutex example to not clutter the basic example). - Update example to build cleanly on Windows with console control handling.
Closes #10.