Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to speed up the refcounting madness by using std::move
[simgrid.git] / src / simix / ActorImpl.cpp
index 5af5070..d0f4ae7 100644 (file)
@@ -38,21 +38,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix, "Logging specific to SIMIX
 
 unsigned long simix_process_maxpid = 0;
 
-/** Increase the refcount for this process */
-smx_actor_t SIMIX_process_ref(smx_actor_t process)
-{
-  if (process != nullptr)
-    intrusive_ptr_add_ref(process);
-  return process;
-}
-
-/** Decrease the refcount for this process */
-void SIMIX_process_unref(smx_actor_t process)
-{
-  if (process != nullptr)
-    intrusive_ptr_release(process);
-}
-
 /**
  * \brief Returns the current agent.
  *
@@ -433,7 +418,7 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
         boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro);
 
     if (exec != nullptr) {
-
+      /* Nothing to do */
     } else if (comm != nullptr) {
       process->comms.remove(process->waiting_synchro);
       comm->cancel();
@@ -449,6 +434,8 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
 
     } else if (io != nullptr) {
       SIMIX_io_destroy(process->waiting_synchro);
+    } else {
+      xbt_die("Unknown type of activity");
     }
 
     /*
@@ -878,10 +865,9 @@ xbt_dynar_t SIMIX_processes_as_dynar() {
 }
 
 void SIMIX_process_on_exit_runall(smx_actor_t process) {
-  s_smx_process_exit_fun_t exit_fun;
   smx_process_exit_status_t exit_status = (process->context->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
   while (not process->on_exit.empty()) {
-    exit_fun = process->on_exit.back();
+    s_smx_process_exit_fun_t exit_fun = process->on_exit.back();
     (exit_fun.fun)((void*)exit_status, exit_fun.arg);
     process->on_exit.pop_back();
   }