Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill trivial MSG_task_has_data() and use get_data()!=NULL instead
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 9 Apr 2010 10:18:37 +0000 (10:18 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 9 Apr 2010 10:18:37 +0000 (10:18 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7505 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/msg/msg.h
src/bindings/lua/simgrid_lua.c
src/msg/task.c

index 12465e6..f75907f 100644 (file)
@@ -114,7 +114,6 @@ XBT_PUBLIC(const char *) MSG_task_get_name(m_task_t task);
 XBT_PUBLIC(MSG_error_t) MSG_task_cancel(m_task_t task);
 XBT_PUBLIC(MSG_error_t) MSG_task_destroy(m_task_t task);
 XBT_PUBLIC(void) MSG_task_ref(m_task_t t);
 XBT_PUBLIC(MSG_error_t) MSG_task_cancel(m_task_t task);
 XBT_PUBLIC(MSG_error_t) MSG_task_destroy(m_task_t task);
 XBT_PUBLIC(void) MSG_task_ref(m_task_t t);
-XBT_PUBLIC(int) MSG_task_has_data(m_task_t t);
 
 XBT_PUBLIC(MSG_error_t) MSG_task_get(m_task_t * task, m_channel_t channel);
 XBT_PUBLIC(MSG_error_t) MSG_task_get_with_timeout(m_task_t * task,
 
 XBT_PUBLIC(MSG_error_t) MSG_task_get(m_task_t * task, m_channel_t channel);
 XBT_PUBLIC(MSG_error_t) MSG_task_get_with_timeout(m_task_t * task,
index 6468de3..7e442ff 100644 (file)
@@ -152,7 +152,7 @@ static int Task_send(lua_State *L)  {
   lua_pop(L,1); // remove the string so that the task is on top of it
   MSG_task_set_data(tk,L); // Copy my stack into the task, so that the receiver can copy the lua task directly
   MSG_error_t res = MSG_task_send(tk,mailbox);
   lua_pop(L,1); // remove the string so that the task is on top of it
   MSG_task_set_data(tk,L); // Copy my stack into the task, so that the receiver can copy the lua task directly
   MSG_error_t res = MSG_task_send(tk,mailbox);
-  while (MSG_task_has_data(tk)) // Don't mess up with my stack: the receiver didn't copy the data yet
+  while (MSG_task_get_data(tk)!=NULL) // Don't mess up with my stack: the receiver didn't copy the data yet
     MSG_process_sleep(0); // yield
 
   if (res != MSG_OK) switch(res) {
     MSG_process_sleep(0); // yield
 
   if (res != MSG_OK) switch(res) {
index 05a1a3e..e3bf5c1 100644 (file)
@@ -279,16 +279,3 @@ void MSG_task_set_priority(m_task_t task, double 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);
-
-}
-