#include <atomic>
#include <csignal>
#include <memory>
#include <stdexcept>
Go to the source code of this file.
|
template<auto & solver_to_stop> |
auto | attach_cancellation (auto &solver) |
| Attach SIGINT and SIGTERM handlers to stop the given solver.
|
|
◆ attach_cancellation()
auto attach_cancellation |
( |
auto & |
solver | ) |
|
Attach SIGINT and SIGTERM handlers to stop the given solver.
- Template Parameters
-
solver_to_stop | Reference to atomic pointer variable that will store a pointer to the solver, should be static, so it can be accessed from the signal handler without causing lifetime issues. |
- Parameters
-
solver | The solver that should be stopped by the handler. |
- Returns
- A RAII object that detaches the handler when destroyed.
Definition at line 19 of file cancel.hpp.