Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
account for a file renaming in this script
[simgrid.git] / src / simix / ActorImpl.cpp
index 5a45462..931c2b8 100644 (file)
@@ -94,7 +94,7 @@ void SIMIX_process_cleanup(smx_process_t process)
   xbt_os_mutex_acquire(simix_global->mutex);
 
   /* cancel non-blocking communications */
-  smx_synchro_t synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
+  smx_activity_t synchro = static_cast<smx_activity_t>(xbt_fifo_pop(process->comms));
   while (synchro != nullptr) {
     simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
 
@@ -128,7 +128,7 @@ void SIMIX_process_cleanup(smx_process_t process)
     } else {
       xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro);
     }
-    synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
+    synchro = static_cast<smx_activity_t>(xbt_fifo_pop(process->comms));
   }
 
   XBT_DEBUG("%p should not be run anymore",process);
@@ -197,9 +197,7 @@ void create_maestro(std::function<void()> code)
 }
 }
 
-/**
- * \brief Creates and runs the maestro process
- */
+/** @brief Creates and runs the maestro process */
 void SIMIX_maestro_create(void (*code)(void*), void* data)
 {
   simgrid::simix::create_maestro(std::bind(code, data));
@@ -395,7 +393,7 @@ smx_process_t SIMIX_process_attach(
   /* Tracing the process creation */
   TRACE_msg_process_create(process->name.c_str(), process->pid, process->host);
 
-  auto context = dynamic_cast<simgrid::simix::AttachContext*>(process->context);
+  auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
   if (!context)
     xbt_die("Not a suitable context");
 
@@ -405,7 +403,7 @@ smx_process_t SIMIX_process_attach(
 
 void SIMIX_process_detach()
 {
-  auto context = dynamic_cast<simgrid::simix::AttachContext*>(SIMIX_context_self());
+  auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(SIMIX_context_self());
   if (!context)
     xbt_die("Not a suitable context");
 
@@ -414,7 +412,7 @@ void SIMIX_process_detach()
   // Let maestro ignore we are still alive:
   // xbt_swag_remove(context->process(), simix_global->process_list);
 
-  // TODDO, Remove from proces list:
+  // TODO, Remove from proces list:
   //   xbt_swag_remove(process, sg_host_simix(host)->process_list);
 
   context->attach_stop();
@@ -602,7 +600,7 @@ void SIMIX_process_change_host(smx_process_t process, sg_host_t dest)
 
 void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process)
 {
-  smx_synchro_t sync_suspend = SIMIX_process_suspend(process, simcall->issuer);
+  smx_activity_t sync_suspend = SIMIX_process_suspend(process, simcall->issuer);
 
   if (process != simcall->issuer) {
     SIMIX_simcall_answer(simcall);
@@ -614,7 +612,7 @@ void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t proces
   /* If we are suspending ourselves, then just do not finish the simcall now */
 }
 
-smx_synchro_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+smx_activity_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
 {
   if (process->suspended) {
     XBT_DEBUG("Process '%s' is already suspended", process->name.c_str());
@@ -748,12 +746,12 @@ void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process,
     SIMIX_simcall_answer(simcall);
     return;
   }
-  smx_synchro_t sync = SIMIX_process_join(simcall->issuer, process, timeout);
+  smx_activity_t sync = SIMIX_process_join(simcall->issuer, process, timeout);
   sync->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = sync;
 }
 
-static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t synchro){
+static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activity_t synchro){
   simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
 
   if (sleep->surf_sleep) {
@@ -779,10 +777,10 @@ static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synch
   return 0;
 }
 
-smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
+smx_activity_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
 {
-  smx_synchro_t res = SIMIX_process_sleep(issuer, timeout);
-  static_cast<simgrid::kernel::activity::Synchro*>(res)->ref();
+  smx_activity_t res = SIMIX_process_sleep(issuer, timeout);
+  static_cast<simgrid::kernel::activity::ActivityImpl*>(res)->ref();
   SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
   return res;
 }
@@ -795,12 +793,12 @@ void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration)
     SIMIX_simcall_answer(simcall);
     return;
   }
-  smx_synchro_t sync = SIMIX_process_sleep(simcall->issuer, duration);
+  smx_activity_t sync = SIMIX_process_sleep(simcall->issuer, duration);
   sync->simcalls.push_back(simcall);
   simcall->issuer->waiting_synchro = sync;
 }
 
-smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration)
+smx_activity_t SIMIX_process_sleep(smx_process_t process, double duration)
 {
   sg_host_t host = process->host;
 
@@ -817,7 +815,7 @@ smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration)
   return synchro;
 }
 
-void SIMIX_process_sleep_destroy(smx_synchro_t synchro)
+void SIMIX_process_sleep_destroy(smx_activity_t synchro)
 {
   XBT_DEBUG("Destroy synchro %p", synchro);
   simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);