simdata->message_size = message_size;
simdata->rate = -1.0;
simdata->priority = 1.0;
- simdata->using = 1;
+ simdata->refcount = 1;
simdata->sender = NULL;
simdata->receiver = NULL;
simdata->cond = SIMIX_cond_init();
xbt_assert0((task != NULL), "Invalid parameter");
/* why? if somebody is using, then you can't free! ok... but will return MSG_OK? when this task will be destroyed? isn't the user code wrong? */
- task->simdata->using--;
- if (task->simdata->using > 0)
+ task->simdata->refcount --;
+ if (task->simdata->refcount > 0)
return MSG_OK;
if (task->name)
}
}
+
+
+/** \ingroup m_task_management
+ * \brief Returns the total amount received by a task #m_task_t.
+ *
+ */
+double MSG_task_get_remaining_communication(m_task_t task)
+{
+ xbt_assert0((task != NULL)
+ && (task->simdata != NULL), "Invalid parameter");
+
+ return SIMIX_action_get_remains(task->simdata->comm);
+}
+
/** \ingroup m_task_management
* \brief Returns the size of the data attached to a task #m_task_t.
*