[PR #10403] Introduce til/latch.h, til/mutex.h and til/throttled_func.h #28029

Open
opened 2026-01-31 09:25:51 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/10403

State: closed
Merged: Yes


This commit introduce three new til features:

  • "til/latch.h": A std::latch clone, until we're on C++20.
  • "til/mutex.h": A safe mutex wrapper, which only allows you access to the protected data after locking it. No more forgetting to lock mutexes!
  • "til/throttled_func.h": Function invocation throttling used to be available as the ThrottledFunc class already. But this class is vastly more efficient and doesn't rely on any WinRT types.

This PR also adds a til::ends_with string helper which is til::starts_with counterpart.

Validation Steps Performed

  • Scrollbar throttling still works as it used to ✔️
  • No performance regressions when printing big.txt ✔️

Closes #10393

**Original Pull Request:** https://github.com/microsoft/terminal/pull/10403 **State:** closed **Merged:** Yes --- This commit introduce three new `til` features: * "til/latch.h": A std::latch clone, until we're on C++20. * "til/mutex.h": A safe mutex wrapper, which only allows you access to the protected data after locking it. No more forgetting to lock mutexes! * "til/throttled_func.h": Function invocation throttling used to be available as the `ThrottledFunc` class already. But this class is vastly more efficient and doesn't rely on any WinRT types. This PR also adds a `til::ends_with` string helper which is `til::starts_with` counterpart. ## Validation Steps Performed * Scrollbar throttling still works as it used to ✔️ * No performance regressions when printing big.txt ✔️ Closes #10393
claunia added the pull-request label 2026-01-31 09:25:51 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28029