Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add 2 new functions to manage actions (SIMIX_action_resume/SIMIX_action_suspend).
authordonassbr <donassbr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 8 Apr 2010 17:31:14 +0000 (17:31 +0000)
committerdonassbr <donassbr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 8 Apr 2010 17:31:14 +0000 (17:31 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7487 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/simix/simix.h
src/simix/smx_action.c

index 97eb4d0..2392b6b 100644 (file)
@@ -165,6 +165,8 @@ XBT_PUBLIC(smx_action_t) SIMIX_action_sleep(smx_host_t host, double amount);
 XBT_PUBLIC(void) SIMIX_action_cancel(smx_action_t action);
 XBT_PUBLIC(void) SIMIX_action_set_priority(smx_action_t action,
                                            double priority);
+XBT_PUBLIC(void) SIMIX_action_resume(smx_action_t action);
+XBT_PUBLIC(void) SIMIX_action_suspend(smx_action_t action);
 XBT_PUBLIC(int) SIMIX_action_destroy(smx_action_t action);
 XBT_PUBLIC(void) SIMIX_action_use(smx_action_t action);
 XBT_PUBLIC(void) SIMIX_action_release(smx_action_t action);
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
  *