10 #ifndef SCARAB_CANCELABLE_HH_ 11 #define SCARAB_CANCELABLE_HH_ 33 bool is_canceled()
const;
36 virtual void do_cancellation(
int a_code );
37 virtual void do_reset_cancellation();
45 if( f_canceled.load() )
return;
46 f_canceled.store(
true );
47 this->do_cancellation( a_code );
52 if( ! f_canceled.load() )
return;
53 f_canceled.store(
false );
54 this->do_reset_cancellation();
59 return f_canceled.load();
bool is_canceled() const
check canceled state
void reset_cancel()
reset to non-canceled state
std::atomic< bool > f_canceled
void cancel(int a_code=0)
asynchronous cancel function