X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f6a147ae4d559391e52232a5d0cde1cd5adf9e62..b83750d410261d5d1831b34937c14a09e9108b8a:/src/simix/smx_process.c diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index da0f7d22fb..f81697360d 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -64,20 +64,12 @@ void SIMIX_process_cleanup(smx_process_t process) action, action->comm.detached, (int)action->state, action->comm.src_proc, action->comm.dst_proc); action->comm.src_proc = NULL; - if (action->comm.detached) { - if (action->comm.refcount == 0) { - XBT_DEBUG("Increase the refcount before destroying it since it's detached"); - /* I'm not supposed to destroy a detached comm from the sender side, - * unless there is no receiver matching the rdv */ - action->comm.refcount++; - SIMIX_comm_destroy(action); - } - else { - XBT_DEBUG("Don't destroy it since its refcount is %d", action->comm.refcount); - } - } else { + /* I'm not supposed to destroy a detached comm from the sender side, */ + if (!action->comm.detached) SIMIX_comm_destroy(action); - } + else + XBT_DEBUG("Don't destroy it since it's a detached comm"); + } else if (action->comm.dst_proc == process){ XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p", @@ -293,10 +285,8 @@ void SIMIX_process_create(smx_process_t *process, xbt_swag_insert(*process, simix_global->process_list); XBT_DEBUG("Inserting %s(%s) in the to_run list", (*process)->name, sg_host_name(host)); xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, *process); - } - if (kill_time > SIMIX_get_clock()) { - if (simix_global->kill_process_function) { + if (kill_time > SIMIX_get_clock() && simix_global->kill_process_function) { XBT_DEBUG("Process %s(%s) will be kill at time %f", (*process)->name, sg_host_name((*process)->smx_host), kill_time); SIMIX_timer_set(kill_time, simix_global->kill_process_function, *process); @@ -702,9 +692,10 @@ static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_actio SIMIX_simcall_answer(simcall); } } - - SIMIX_process_sleep_destroy(action); + surf_action_unref(action->sleep.surf_sleep); + action->sleep.surf_sleep = NULL; } + xbt_mallocator_release(simix_global->action_mallocator, action); return 0; }