Disk ARchive
2.4.21
|
class to be used as parent to provide checkpoints to inherited classes More...
#include <thread_cancellation.hpp>
Inherited by libdar::fichier, libdar::null_file, and libdar::tuyau.
Public Member Functions | |
thread_cancellation () | |
the constructor | |
virtual | ~thread_cancellation () |
the destructor | |
void | check_self_cancellation () const |
Checkpoint test : whether the current libdar call must abort or not. More... | |
void | block_delayed_cancellation (bool mode) |
Static Public Member Functions | |
static void | init () |
mandatory initialization static method More... | |
static U_I | count () |
method for debugging/control purposes | |
class to be used as parent to provide checkpoints to inherited classes
the class provides a checkpoints to inherited classes and a mechanism that let any libdar external code to ask the termination of a libdar call executing in a given thread. This does not imply the termination of the thread itself but it implies the return of the thread execution to the code that called libdar
Definition at line 63 of file thread_cancellation.hpp.
void libdar::thread_cancellation::block_delayed_cancellation | ( | bool | mode | ) |
by default delayed (non immediate) cancellation generate a specific exception, it is possible for delayed cancellation only, do block such exceptions for a certain time
[in] | mode | can be set to true to block delayed cancellations |
void libdar::thread_cancellation::check_self_cancellation | ( | ) | const |
Checkpoint test : whether the current libdar call must abort or not.
Euser_abort | is thrown if the thread the checkpoint is running from is marked as to be canceled. |
Referenced by libdar::null_file::inherited_read(), and libdar::null_file::inherited_write().
|
static |
mandatory initialization static method
must be called once before any call to thread_cancellation class's methods