From: mquinson Date: Fri, 9 Apr 2010 10:18:37 +0000 (+0000) Subject: kill trivial MSG_task_has_data() and use get_data()!=NULL instead X-Git-Tag: SVN~235 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d74bb413a4b25a580d7cfc96065b638292a2e679 kill trivial MSG_task_has_data() and use get_data()!=NULL instead git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7505 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/msg/msg.h b/include/msg/msg.h index 12465e6b3d..f75907f210 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -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(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, diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index 6468de3b2b..7e442ff138 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -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); - 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) { diff --git a/src/msg/task.c b/src/msg/task.c index 05a1a3e907..e3bf5c158a 100644 --- a/src/msg/task.c +++ b/src/msg/task.c @@ -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); - -} -