Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Begin adding tests for subtree rooting
[simgrid.git] / src / plugins / operation.cpp
index ce34fe68fdf5ca18df7006a0adf1535dd5afa529..32ed8661b4773d4bfb13d236ff75b4d5beafdd2f 100644 (file)
@@ -170,6 +170,17 @@ void Operation::remove_successor(OperationPtr successor)
   successor->remove_predecessor(this);
 }
 
+void Operation::remove_all_successors()
+{
+  simgrid::kernel::actor::simcall_answered([this] {
+    while (not successors_.empty()) {
+      auto* successor = *(successors_.begin());
+      successor->predecessors_.erase(this);
+      successors_.erase(successor);
+    }
+  });
+}
+
 /** @ingroup plugin_operation
  *  @param func The function to set.
  *  @brief Set a function to be called before each execution.