Skip to content

Conversation

@basdp
Copy link
Contributor

@basdp basdp commented Nov 26, 2025

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.

Schermafbeelding 2025-11-26 104913

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing wrappers for lock-specific functions (e.g. TracyLockable)

1 participant