Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a MSG_task_set_data() function
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 24 Mar 2010 16:07:42 +0000 (16:07 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 24 Mar 2010 16:07:42 +0000 (16:07 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7356 48e7efb5-ca39-0410-a469-dd3cf9ba447f

ChangeLog
include/msg/msg.h
src/msg/task.c

index 8af0af6..1636c13 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@ SimGrid (3.3.5-svn) unstable; urgency=low
   * Kill the MSG_paje_output() function. It's a noop since 2 years.
   * Kill MSG_WARNING and MSG_FATAL return codes: they were not used
     anywere in source.
   * Kill the MSG_paje_output() function. It's a noop since 2 years.
   * Kill MSG_WARNING and MSG_FATAL return codes: they were not used
     anywere in source.
+  * Add a MSG_task_set_data() function
  SIMIX:
   * add a SIMIX_sem_get_capacity() function
  SMPI:
  SIMIX:
   * add a SIMIX_sem_get_capacity() function
  SMPI:
index 33c7a59..d6c1adf 100644 (file)
@@ -107,6 +107,7 @@ XBT_PUBLIC(m_task_t) MSG_parallel_task_create(const char *name, int host_nb,
                                               double *communication_amount,
                                               void *data);
 XBT_PUBLIC(void *) MSG_task_get_data(m_task_t task);
                                               double *communication_amount,
                                               void *data);
 XBT_PUBLIC(void *) MSG_task_get_data(m_task_t task);
+XBT_PUBLIC(void) MSG_task_set_data(m_task_t task,void*data);
 XBT_PUBLIC(m_process_t) MSG_task_get_sender(m_task_t task);
 XBT_PUBLIC(m_host_t) MSG_task_get_source(m_task_t task);
 XBT_PUBLIC(const char *) MSG_task_get_name(m_task_t task);
 XBT_PUBLIC(m_process_t) MSG_task_get_sender(m_task_t task);
 XBT_PUBLIC(m_host_t) MSG_task_get_source(m_task_t task);
 XBT_PUBLIC(const char *) MSG_task_get_name(m_task_t task);
index 8aae84d..6d4bbbf 100644 (file)
@@ -84,7 +84,7 @@ void MSG_task_ref(m_task_t t) {
 /** \ingroup m_task_management
  * \brief Return the user data of a #m_task_t.
  *
 /** \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)
    the user data associated to \a task if it is possible.
  */
 void *MSG_task_get_data(m_task_t task)
@@ -94,6 +94,19 @@ void *MSG_task_get_data(m_task_t task)
   return (task->data);
 }
 
   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.
  *
 /** \ingroup m_task_management
  * \brief Return the sender of a #m_task_t.
  *