Skip to content

[codex] Implement cancellable thread pool tasks - #29

Merged
ntoskrnl7 merged 1 commit into
masterfrom
fix/thread-pool-cancel-policy
Jun 15, 2026
Merged

ntoskrnl7 merged 1 commit into
masterfrom
fix/thread-pool-cancel-policy

Conversation

@ntoskrnl7

Copy link
Copy Markdown
Owner

Summary

  • implement thread_pool::queue_item::cancel() for tasks that have not started running
  • add queue_cancellable() so callers can obtain a queue_item<T> and cancel pending work
  • complete canceled task futures with ext::thread_pool::task_canceled
  • make worker initializer failure stop startup and return false from start()
  • keep finalizers tied to workers that successfully initialized
  • document the cancellable queue and initializer failure contract

Verification

  • git diff --check
  • Markdown fence/link checks for README.md and docs/**/*.md
  • direct compile/run smoke test with c++ -std=c++17 -pthread -Iinclude
  • /tmp/cmake-3.30.5/bin/cmake -S test -B /tmp/ntoskrnl7-ext-build-thread-cancel -DCMAKE_BUILD_TYPE=Release
  • /tmp/cmake-3.30.5/bin/cmake --build /tmp/ntoskrnl7-ext-build-thread-cancel --config Release -j 2
  • /tmp/cmake-3.30.5/bin/ctest --test-dir /tmp/ntoskrnl7-ext-build-thread-cancel -C Release --output-on-failure

@ntoskrnl7
ntoskrnl7 marked this pull request as ready for review June 15, 2026 07:15
@ntoskrnl7
ntoskrnl7 merged commit 0db1bab into master Jun 15, 2026
8 checks passed
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.

1 participant