+
+ if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
+ __SIMIX_cond_display_actions(cond);
+
+ DEBUG2("Register condition %p to action %p", cond, action);
+
+ if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
+ __SIMIX_action_display_conditions(action);
+
+ xbt_fifo_push(action->cond_list, cond);
+
+ if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
+ __SIMIX_action_display_conditions(action);
+}
+
+/**
+ * \brief Unset an action to a condition.
+ *
+ * Destroys the "links" from the condition to this action.
+ * \param action SIMIX action
+ * \param cond SIMIX cond
+ */
+void SIMIX_unregister_action_to_condition(smx_action_t action,
+ smx_cond_t cond)
+{
+ xbt_assert0((action != NULL) && (cond != NULL), "Invalid parameters");
+
+ if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
+ __SIMIX_cond_display_actions(cond);
+
+ xbt_fifo_remove_all(cond->actions, action);
+
+ if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
+ __SIMIX_cond_display_actions(cond);
+
+ if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
+ __SIMIX_action_display_conditions(action);
+
+ xbt_fifo_remove_all(action->cond_list, cond);
+
+ if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
+ __SIMIX_action_display_conditions(action);
+}
+
+/**
+ * \brief Link an action to a semaphore
+ *
+ * When the action terminates, the semaphore gets signaled automatically.
+ */
+XBT_INLINE void SIMIX_register_action_to_semaphore(smx_action_t action,
+ smx_sem_t sem)
+{
+
+ DEBUG2("Register action %p to semaphore %p (and otherwise)", action,
+ sem);
+ xbt_fifo_push(sem->actions, action);
+ xbt_fifo_push(action->sem_list, sem);
+}
+
+/**
+ * \brief Unset an action to a semaphore.
+ *
+ * Destroys the "links" from the semaphore to this action.
+ */
+XBT_INLINE void SIMIX_unregister_action_to_semaphore(smx_action_t action,
+ smx_sem_t sem)
+{
+ xbt_fifo_remove_all(sem->actions, action);
+ xbt_fifo_remove_all(action->sem_list, sem);