Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add 2 new functions to manage actions (SIMIX_action_resume/SIMIX_action_suspend).
[simgrid.git] / src / simix / smx_action.c
index 7984882..b4a3b67 100644 (file)
@@ -184,6 +184,36 @@ XBT_INLINE void SIMIX_action_set_priority(smx_action_t action, double priority)
   return;
 }
 
+/**
+ *     \brief Resumes the execution of an action.
+ *
+ *  This functions restarts the execution of an action. It just calls the right SURF function.
+ *  \param action The SIMIX action
+ *  \param priority The new priority
+ */
+XBT_INLINE void SIMIX_action_resume(smx_action_t action)
+{
+  xbt_assert0((action != NULL), "Invalid parameter");
+
+  surf_workstation_model->resume(action->surf_action);
+  return;
+}
+
+/**
+ *  \brief Suspends the execution of an action.
+ *
+ *  This functions suspends the execution of an action. It just calls the right SURF function.
+ *  \param action The SIMIX action
+ *  \param priority The new priority
+ */
+XBT_INLINE void SIMIX_action_suspend(smx_action_t action)
+{
+  xbt_assert0((action != NULL), "Invalid parameter");
+
+  surf_workstation_model->suspend(action->surf_action);
+  return;
+}
+
 /**
  *     \brief Destroys an action
  *