No description
  • C++ 86.2%
  • Starlark 8.9%
  • Just 4.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-27 05:19:10 +01:00
micha feat(thread-worker): mutex-protect updating the callback 2026-10-27 13:05:03 +09:00
.bazelrc feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
.bazelversion feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
.editorconfig feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
.gitignore feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
BUILD.bazel feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
justfile feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
MODULE.bazel feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
MODULE.bazel.lock feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00
README.md Update README.md 2026-10-27 05:19:10 +01:00
WORKSPACE feat(thread-worker): project skeleton 2026-10-26 12:38:31 +09:00

moveable-thread

A small sample demonstrating how to wrap a thread with mutex synchronisation into a set of classes which allows moving the main class.

Basically:

  • std::thread is movable
  • std::mutex and std::condition_variable are not

So the idea is to have a ThreadWrapper class, and a main ThreadWorker class. The ThreadWorker is movable, and only contains a pointer to a ThreadWrapper, allowing the pointer to be moved.