simdata->message_size = message_size;
simdata->rate = -1.0;
simdata->priority = 1.0;
- simdata->refcount = 1;
+ simdata->isused = 0;
simdata->sender = NULL;
simdata->receiver = NULL;
simdata->compute = NULL;
task->name = xbt_strdup(name);
}
-
-void MSG_task_refcount_dec(m_task_t task)
-{
- task->simdata->refcount--;
-}
-
/** \ingroup m_task_management
* \brief Destroy a #m_task_t.
*
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->refcount--;
- if (task->simdata->refcount > 0)
+ if (task->simdata->isused > 0) {
+ DEBUG1("Cannot destroy task %p since somebody is using it", task);
return MSG_OK;
+ }
#ifdef HAVE_TRACING
TRACE_msg_task_destroy(task);
#endif