Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill 3 more functions around processes
[simgrid.git] / src / msg / msg_process.cpp
index 77ccfef..0a2d2a9 100644 (file)
@@ -363,10 +363,9 @@ int MSG_process_get_PID(msg_process_t process)
 {
   /* Do not raise an exception here: this function is called by the logs
    * and the exceptions, so it would be called back again and again */
-  if (process == nullptr) {
+  if (process == nullptr)
     return 0;
-  }
-  return simcall_process_get_PID(process);
+  return process->pid;
 }
 
 /** \ingroup m_process_management
@@ -377,8 +376,7 @@ int MSG_process_get_PID(msg_process_t process)
  */
 int MSG_process_get_PPID(msg_process_t process)
 {
-  xbt_assert(process != nullptr, "Invalid parameter: First argument must not be nullptr");
-  return simcall_process_get_PPID(process);
+  return process->ppid;
 }
 
 /** \ingroup m_process_management
@@ -388,8 +386,7 @@ int MSG_process_get_PPID(msg_process_t process)
  */
 const char *MSG_process_get_name(msg_process_t process)
 {
-  xbt_assert(process != nullptr, "Invalid parameter: First argument must not be nullptr");
-  return simcall_process_get_name(process);
+  return process->name.c_str();
 }
 
 /** \ingroup m_process_management
@@ -456,7 +453,7 @@ msg_error_t MSG_process_suspend(msg_process_t process)
 
   TRACE_msg_process_suspend(process);
   simcall_process_suspend(process);
-  MSG_RETURN(MSG_OK);
+  return MSG_OK;
 }
 
 /** \ingroup m_process_management
@@ -470,7 +467,7 @@ msg_error_t MSG_process_resume(msg_process_t process)
 
   TRACE_msg_process_resume(process);
   simcall_process_resume(process);
-  MSG_RETURN(MSG_OK);
+  return MSG_OK;
 }
 
 /** \ingroup m_process_management