+ xbt_assert0((action != NULL)
+ && (action->simdata != NULL), "Invalid parameter");
+
+ surf_workstation_resource->common_public->
+ set_priority(action->simdata->surf_action, priority);
+ return;
+}
+
+/**
+ * \brief Destroys an action
+ *
+ * Destroys an action, freing its memory. This function cannot be called if there are a conditional waiting for it.
+ * \param action The SIMIX action
+ */
+void SIMIX_action_destroy(smx_action_t action)
+{
+ xbt_assert0((action != NULL), "Invalid parameter");
+
+ xbt_assert1((xbt_fifo_size(action->cond_list) == 0),
+ "Conditional list not empty %d. There is a problem. Cannot destroy it now!",
+ xbt_fifo_size(action->cond_list));
+
+ DEBUG1("Destroy action %p", action);
+ if (action->name)
+ xbt_free(action->name);
+
+ xbt_fifo_free(action->cond_list);
+
+ if (action->simdata->surf_action)
+ action->simdata->surf_action->resource_type->common_public->
+ action_free(action->simdata->surf_action);
+
+ xbt_free(action->simdata);
+ xbt_free(action);
+ return;
+}
+
+/**
+ * \brief Set an action to a condition
+ *
+ * Creates the "link" between an action and a condition. You have to call this function when you create an action and want to wait its ending.
+ * \param action SIMIX action
+ * \param cond SIMIX cond
+ */
+void SIMIX_register_action_to_condition(smx_action_t action,
+ smx_cond_t cond)
+{
+ xbt_assert0((action != NULL) && (cond != NULL), "Invalid parameters");
+
+ DEBUG2("Register action %p to cond %p", action, cond);
+ __SIMIX_cond_display_actions(cond);
+ xbt_fifo_push(cond->actions, action);
+ __SIMIX_cond_display_actions(cond);
+ DEBUG2("Register condition %p to action %p", cond, action);
+ __SIMIX_action_display_conditions(action);
+ xbt_fifo_push(action->cond_list, cond);
+ __SIMIX_action_display_conditions(action);
+}