Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Nobody uses MSG_get_errno and wants useless calls to SIMIX_process_self
authorChristophe Thiéry <christopho128@gmail.com>
Tue, 15 Nov 2011 17:57:13 +0000 (18:57 +0100)
committerChristophe Thiéry <christopho128@gmail.com>
Tue, 15 Nov 2011 17:59:11 +0000 (18:59 +0100)
include/msg/msg.h
src/msg/msg_gos.c
src/msg/msg_private.h

index 2053b4e..fb3aebd 100644 (file)
@@ -156,7 +156,6 @@ XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel);
 XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel);
 XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, m_host_t host);
 XBT_PUBLIC(MSG_error_t) MSG_process_sleep(double nb_sec);
-XBT_PUBLIC(MSG_error_t) MSG_get_errno(void);
 
 XBT_PUBLIC(double) MSG_task_get_compute_duration(m_task_t task);
 XBT_PUBLIC(void) MSG_task_set_compute_duration(m_task_t task,
@@ -237,6 +236,7 @@ MSG_error_t MSG_action_trace_run(char *path);
         MSG_mailbox_put_with_timeout(mailbox, task, timeout)
 
 #define MSG_process_change_host(h) MSG_process_migrate(MSG_process_self(),h);
+XBT_PUBLIC(MSG_error_t) MSG_get_errno(void);
 #endif
 
 #include "instr/instr.h"
index ff040ca..608d9d5 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg,
                                 "Logging specific to MSG (gos)");
 
-/** \ingroup msg_gos_functions
- *
- * \brief Return the last value returned by a MSG function (except
- * MSG_get_errno...).
- */
-MSG_error_t MSG_get_errno(void)
-{
-  return PROCESS_GET_ERRNO();
-}
-
 /** \ingroup msg_gos_functions
  * \brief Executes a task and waits for its termination.
  *
@@ -982,3 +972,15 @@ int MSG_task_listen_from(const char *alias)
 
   return MSG_process_get_PID(task->simdata->sender);
 }
+
+#ifdef MSG_USE_DEPRECATED
+/** \ingroup msg_gos_functions
+ *
+ * \brief Return the last value returned by a MSG function (except
+ * MSG_get_errno...).
+ */
+MSG_error_t MSG_get_errno(void)
+{
+  return PROCESS_GET_ERRNO();
+}
+#endif
index c08ac68..cf9f975 100644 (file)
@@ -93,15 +93,19 @@ XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
 
 /*************************************************************/
 
-#define PROCESS_SET_ERRNO(val) \
+#ifdef MSG_USE_DEPRECATED
+#  define PROCESS_SET_ERRNO(val) \
   (((simdata_process_t) SIMIX_process_self_get_data(SIMIX_process_self()))->last_errno=val)
-#define PROCESS_GET_ERRNO() \
+#  define PROCESS_GET_ERRNO() \
   (((simdata_process_t) SIMIX_process_self_get_data(SIMIX_process_self()))->last_errno)
 #define MSG_RETURN(val) do {PROCESS_SET_ERRNO(val);return(val);} while(0)
 /* #define CHECK_ERRNO()  ASSERT((PROCESS_GET_ERRNO()!=MSG_HOST_FAILURE),"Host failed, you cannot call this function.") */
 
 /*#define CHECK_HOST()  xbt_assert(SIMIX_req_host_get_state(SIMIX_host_self())==1,\
                                   "Host failed, you cannot call this function. (state=%d)",SIMIX_req_host_get_state(SIMIX_host_self()))*/
+#else
+#  define MSG_RETURN(val) return(val)
+#endif
 #define CHECK_HOST()
 
 m_host_t __MSG_host_create(smx_host_t workstation, void *data);