*/
void SIMIX_process_cleanup(smx_actor_t process)
{
- XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->name.c_str(), process, process->waiting_synchro);
+ XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->name.c_str(), process,
+ process->waiting_synchro.get());
process->finished = true;
SIMIX_process_on_exit_runall(process);
* because src_proc or dst_proc would be an invalid pointer */
if (comm->src_proc == process) {
- XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p",
- comm, comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc);
+ XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p", comm.get(),
+ comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc);
comm->src_proc = nullptr;
} else if (comm->dst_proc == process) {
- XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",
- comm, (int)comm->state, comm->src_proc, comm->dst_proc);
+ XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p", comm.get(), (int)comm->state,
+ comm->src_proc, comm->dst_proc);
comm->dst_proc = nullptr;
if (comm->detached && comm->src_proc != nullptr) {
comm->src_proc->comms.remove(comm);
}
} else {
- xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro);
+ xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro.get());
}
process->comms.pop_front();
synchro = process->comms.front();
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();
} else if (io != nullptr) {
SIMIX_io_destroy(process->waiting_synchro);
+ } else {
+ xbt_die("Unknown type of activity");
}
/*
}
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();
}
* \param properties the properties of the process
* \param auto_restart either it is autorestarting or not.
*/
+extern "C"
smx_actor_t simcall_process_create(const char* name, xbt_main_func_t code, void* data, sg_host_t host, int argc,
char** argv, xbt_dict_t properties)
{