|
Player12
An open source football management simulator
|
#include <future>#include <thread>#include <type_traits>#include <utility>Go to the source code of this file.
Functions | |
| template<class Function > | |
| auto | launchBackgroundTask (std::jthread &worker, Function function) |
| auto launchBackgroundTask | ( | std::jthread & | worker, |
| Function | function | ||
| ) |
Starts work on an explicitly owned thread and returns its result channel. The owner must outlive captured objects. Reusing or destroying the worker joins its previous task; exceptions travel through the returned future.