// start the new process
ActorImpl* actor = simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.host,
- arg.properties, nullptr);
+ arg.properties.get(), nullptr);
if (arg.kill_time >= 0)
simcall_process_set_kill_time(actor, arg.kill_time);
if (arg.auto_restart)
/* Add properties */
if (properties != nullptr)
- for (auto kv : *properties)
+ for (auto const& kv : *properties)
process->setProperty(kv.first, kv.second);
/* Make sure that the process is initialized for simix, in case we are called from the Host::onCreation signal */
/* Add properties */
if (properties != nullptr)
- for (auto kv : *properties)
+ for (auto const& kv : *properties)
process->setProperty(kv.first, kv.second);
/* Add the process to it's host process list */
if (not context)
xbt_die("Not a suitable context");
- simix_global->cleanup_process_function(context->process());
-
- // Let maestro ignore we are still alive:
- // xbt_swag_remove(context->process(), simix_global->process_list);
-
- // TODO, Remove from proces list:
- // xbt_swag_remove(process, sg_host_simix(host)->process_list);
-
+ auto process = context->process();
+ simix_global->cleanup_process_function(process);
context->attach_stop();
- // delete context;
+ delete process;
}
/**
simix_global->process_to_run.clear();
}
-void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_actor_t process) {
- SIMIX_process_kill(process, simcall->issuer);
-}
/**
* \brief Internal function to kill a SIMIX process.
*
simgrid::kernel::activity::ExecImplPtr exec =
boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
- if (exec != nullptr) {
- SIMIX_execution_cancel(process->waiting_synchro);
- }
+ if (exec != nullptr && exec->surf_exec)
+ exec->surf_exec->cancel();
simgrid::kernel::activity::CommImplPtr comm =
boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro);
*/
void SIMIX_process_killall(smx_actor_t issuer, int reset_pid)
{
- for (auto kv : simix_global->process_list)
+ for (auto const& kv : simix_global->process_list)
if (kv.second != issuer)
SIMIX_process_kill(kv.second, issuer);
smx_actor_t SIMIX_process_get_by_name(const char* name)
{
- for (auto kv : simix_global->process_list)
+ for (auto const& kv : simix_global->process_list)
if (kv.second->name == name)
return kv.second;
return nullptr;