$darkmode
#include <atomic>#include <stdexcept>Go to the source code of this file.
Classes | |
| class | cloe::AsyncAbort |
Typedefs | |
| using | cloe::AbortFlag = std::atomic_bool |
Functions | |
| void | cloe::abort_checkpoint (AbortFlag &sig) |
| using cloe::AbortFlag = typedef std::atomic_bool |
AbortFlag can be included in a plugin to allow asynchronous aborts to be signalled.
The abort() method of a plugin can be called asynchronously and should simply store true in the AbortFlag:
abort_flag.store(true);
|
inline |
Create an abort checkpoint.
In places where the plugin code might spin for longer periods, the abort_checkpoint() function can be utilized to provide a place to escape. This will throw the AsyncAbort exception, which should be caught by the simulation framework.