Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a function I need in GRAS
[simgrid.git] / src / msg / task.c
index 530be8b..af973f0 100644 (file)
@@ -67,6 +67,18 @@ void *MSG_task_get_data(m_task_t task)
   return (task->data);
 }
 
   return (task->data);
 }
 
+/** \ingroup m_task_management
+ * \brief Return the sender of a #m_task_t.
+ *
+ * This functions returns the #m_process_t which sent this task
+ */
+m_process_t MSG_task_get_sender(m_task_t task)
+{
+   xbt_assert0(task, "Invalid parameters");
+   return ((simdata_task_t) task->simdata)->sender;
+}
+
+
 /** \ingroup m_task_management
  * \brief Destroy a #m_task_t.
  *
 /** \ingroup m_task_management
  * \brief Destroy a #m_task_t.
  *