No description
- C++ 86.2%
- Starlark 8.9%
- Just 4.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| micha | ||
| .bazelrc | ||
| .bazelversion | ||
| .editorconfig | ||
| .gitignore | ||
| BUILD.bazel | ||
| justfile | ||
| MODULE.bazel | ||
| MODULE.bazel.lock | ||
| README.md | ||
| WORKSPACE | ||
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.