<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/timer-queue-timers-at-shutdown-0yhog10tm" -->

---
title: Timer Queue timers at shutdown | daily.dev
description: Continuing a long-running series on retrofitting controlled shutdown into a multi-threaded C++ timer library, this installment implements the shutdown changes...
canonical: https://daily.dev/posts/timer-queue-timers-at-shutdown-0yhog10tm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Timer Queue timers at shutdown | daily.dev
og:description: Continuing a long-running series on retrofitting controlled shutdown into a multi-threaded C++ timer library, this installment implements the shutdown changes...
og:url: https://daily.dev/posts/timer-queue-timers-at-shutdown-0yhog10tm
og:image: https://api.daily.dev/og/posts/0yHOg10tm.png
og:image:alt: Timer Queue timers at shutdown
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Timer Queue timers at shutdown

**[Rambling Comments](https://daily.dev/sources/lenholgate)** · 3 min read · 0 upvotes · 0 comments

## Summary

Continuing a long-running series on retrofitting controlled shutdown into a multi-threaded C++ timer library, this installment implements the shutdown changes in the timer queue class, mirroring the earlier timer wheel implementation. It covers moving unit tests to a shared templated test harness, handling the tricky case of collecting all timers during shutdown, and fixing an inconsistency so that both timer classes initiate shutdown properly when wrapped in a thread-safe facade. The code builds with Visual Studio 2022 and 2026, targets Windows 10 by default, and is available on GitHub under the MIT license.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://lenholgate.com/blog/2026/10/practical-testing-46-timer-queue-timers-at-shutdown.html>

## Similar posts on daily.dev

- [Timers pending at shutdown](https://daily.dev/posts/timers-pending-at-shutdown-w3r7iwp1b) · Rambling Comments · 1 upvotes · 1 comments
- [Timer Wheel timers at shutdown](https://daily.dev/posts/timer-wheel-timers-at-shutdown-tq3ug5eii) · Rambling Comments · 0 upvotes · 0 comments
- [Practical Testing: 43](https://daily.dev/posts/practical-testing-43-bcfdxy2eh) · Rambling Comments · 0 upvotes · 0 comments
- [Time in C\+\+: Once More About Testing](https://daily.dev/posts/time-in-c-once-more-about-testing-xgwh6hhhf) · Sandor Dargo · 1 upvotes · 0 comments
- [All About Jest, Timers, and Mocks](https://daily.dev/posts/all-about-jest-timers-and-mocks-uvpmlenzh) · Liran Tal · 0 upvotes · 0 comments

---

Tags: [#general-programming](https://daily.dev/tags/general-programming), [#testing](https://daily.dev/tags/testing), [#c++](https://daily.dev/tags/c++)

[View this post on daily.dev](https://daily.dev/posts/timer-queue-timers-at-shutdown-0yhog10tm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Timer Queue timers at shutdown","url":"https://daily.dev/posts/timer-queue-timers-at-shutdown-0yhog10tm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/timer-queue-timers-at-shutdown-0yhog10tm"},"datePublished":"2026-10-01T11:16:45.339Z","dateModified":"2026-10-01T11:16:59.288Z","description":"Continuing a long-running series on retrofitting controlled shutdown into a multi-threaded C++ timer library, this installment implements the shutdown changes...","image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","thumbnailUrl":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","isAccessibleForFree":true,"articleSection":"Rambling Comments","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Rambling Comments","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6848ae9421714c45987b2b6509433655","url":"https://daily.dev/sources/lenholgate"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/timer-queue-timers-at-shutdown-0yhog10tm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"general-programming,testing,c++","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Rambling Comments","item":"https://daily.dev/sources/lenholgate"},{"@type":"ListItem","position":3,"name":"Timer Queue timers at shutdown"}]}
```

