Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove extern "C" from cpp files.
[simgrid.git] / src / msg / msg_process.cpp
index d352e3e..a9e2a3c 100644 (file)
@@ -10,8 +10,6 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
 
-extern "C" {
-
 /** @addtogroup m_process_management
  *
  *  Processes (#msg_process_t) are independent agents that can do stuff on their own. They are in charge of executing
@@ -40,7 +38,9 @@ void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_actor)
     simcall_process_set_data(smx_actor, nullptr);
   }
 
-  TRACE_msg_process_destroy(smx_actor->ciface());
+  if (TRACE_actor_is_enabled())
+    simgrid::instr::Container::byName(instr_pid(smx_actor->ciface()))->removeFromParent();
+
   // free the data if a function was provided
   if (msg_actor && msg_actor->data && msg_global->process_data_cleanup) {
     msg_global->process_data_cleanup(msg_actor->data);
@@ -139,7 +139,6 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
   xbt_free(argv);
   return res;
 }
-}
 
 msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data, msg_host_t host,
                                               std::map<std::string, std::string>* properties)
@@ -158,8 +157,6 @@ msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<vo
   return process->ciface();
 }
 
-extern "C" {
-
 /* Become a process in the simulation
  *
  * Currently this can only be called by the main thread (once) and only work with some thread factories
@@ -197,40 +194,6 @@ void MSG_process_detach()
   SIMIX_process_detach();
 }
 
-/** \ingroup m_process_management
- * \param process poor victim
- *
- * This function simply kills a \a process... scary isn't it ? :)
- */
-void MSG_process_kill(msg_process_t process)
-{
-  process->kill();
-}
-
-/**
-* \brief Wait for the completion of a #msg_process_t.
-*
-* \param process the process to wait for
-* \param timeout wait until the process is over, or the timeout occurs
-*/
-msg_error_t MSG_process_join(msg_process_t process, double timeout){
-  process->join(timeout);
-  return MSG_OK;
-}
-
-/** \ingroup m_process_management
- * \brief Migrates a process to another location.
- *
- * This function checks whether \a process and \a host are valid pointers and change the value of the #msg_host_t on
- * which \a process is running.
- */
-msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
-{
-  TRACE_msg_process_change_host(process, host);
-  process->migrate(host);
-  return MSG_OK;
-}
-
 /** Yield the current actor; let the other actors execute first */
 void MSG_process_yield()
 {
@@ -306,19 +269,6 @@ int MSG_process_get_number()
   return SIMIX_process_count();
 }
 
-/** \ingroup m_process_management
- * \brief Set the kill time of a process.
- *
- * \param process a process
- * \param kill_time the time when the process is killed.
- */
-msg_error_t MSG_process_set_kill_time(msg_process_t process, double kill_time)
-{
-  process->setKillTime(kill_time);
-  return MSG_OK;
-}
-
-
 /** \ingroup m_process_management
  * \brief Return the PID of the current process.
  *
@@ -358,7 +308,7 @@ msg_process_t MSG_process_self()
   return SIMIX_process_self()->ciface();
 }
 
-smx_context_t MSG_process_get_smx_ctx(msg_process_t process) {
+smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { // deprecated -- smx_context_t should die afterward
   return process->getImpl()->context;
 }
 /**
@@ -394,4 +344,3 @@ XBT_PUBLIC void MSG_process_unref(msg_process_t process)
 {
   intrusive_ptr_release(process);
 }
-}