Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Factor Activity::cancel() through CRTP.
[simgrid.git] / src / s4u / s4u_Activity.cpp
index 002035c..00b3ff4 100644 (file)
@@ -41,6 +41,13 @@ bool Activity::test()
   return false;
 }
 
+Activity* Activity::cancel()
+{
+  kernel::actor::simcall([this] { pimpl_->cancel(); });
+  complete(State::CANCELED);
+  return this;
+}
+
 Activity* Activity::suspend()
 {
   if (suspended_)