* <em>message size</em> and some <em>private data</em>.
*/
-#ifdef HAVE_RUBY /* FIXME: KILLME */
-XBT_LOG_EXTERNAL_CATEGORY(ruby);
-#endif
-
/********************************* Task **************************************/
/** \ingroup m_task_management
* \brief Creates a new #m_task_t.
simdata->host_list = NULL;
simdata->comp_amount = NULL;
simdata->comm_amount = NULL;
-
-#ifdef HAVE_RUBY /* FIXME: KILLME */
- CINFO2(ruby,"Created task %p: %s",task,name);
+#ifdef HAVE_TRACING
+ TRACE_msg_task_create (task);
#endif
return task;
}
+/** prevent the task from being destroyed too quickly (but also prevent it from being sent). Mainly useful in bindings */
+void MSG_task_ref(m_task_t t) {
+ t->simdata->refcount++;
+}
+
/** \ingroup m_task_management
* \brief Return the user data of a #m_task_t.
*
- * This functions checks whether \a task is a valid pointer or not and return
+ * This function checks whether \a task is a valid pointer or not and return
the user data associated to \a task if it is possible.
*/
void *MSG_task_get_data(m_task_t task)
return (task->data);
}
+/** \ingroup m_task_management
+ * \brief Sets the user data of a #m_task_t.
+ *
+ * This function allows to associate a new pointer to
+ the user data associated of \a task.
+ */
+void MSG_task_set_data(m_task_t task,void *data)
+{
+ xbt_assert0((task != NULL), "Invalid parameter");
+
+ task->data = data;
+}
+
/** \ingroup m_task_management
* \brief Return the sender of a #m_task_t.
*
task->simdata->refcount--;
if (task->simdata->refcount > 0)
return MSG_OK;
+#ifdef HAVE_TRACING
+ TRACE_msg_task_destroy (task);
+#endif
if (task->name)
free(task->name);
SIMIX_communication_cancel(task->simdata->comm);
return MSG_OK;
}
-
- return MSG_FATAL;
+ THROW_IMPOSSIBLE;
}
/** \ingroup m_task_management
SIMIX_action_set_priority(task->simdata->compute,
task->simdata->priority);
}
+
+
+/** \ingroup m_task_management
+ * \brief Sets the user data of a #m_task_t.
+ *
+ * This function allows to test if a task contains a not_null data
+ * return 1 (if true)
+ */
+int MSG_task_has_data(m_task_t task)
+{
+
+ return (task->data != NULL);
+
+}
+