X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ec3bf45915829f16601f4a221afff11f7bf0a138..a4ff507efa9c473f29ade8357ce148274fbd1e97:/src/mc/mc_state.c?ds=sidebyside diff --git a/src/mc/mc_state.c b/src/mc/mc_state.c index c7ff71ce1b..64dcb1a3b6 100644 --- a/src/mc/mc_state.c +++ b/src/mc/mc_state.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-2014. The SimGrid Team. + * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -142,6 +143,7 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value) smx_process_t process = NULL; mc_procstate_t procstate = NULL; unsigned int start_count; + smx_action_t act = NULL; xbt_swag_foreach(process, simix_global->process_list){ procstate = &state->proc_status[process->pid]; @@ -185,11 +187,14 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value) break; case SIMCALL_COMM_WAIT: - if(simcall_comm_wait__get__comm(&process->simcall)->comm.src_proc - && simcall_comm_wait__get__comm(&process->simcall)->comm.dst_proc){ + act = simcall_comm_wait__get__comm(&process->simcall); + if(act->comm.src_proc && act->comm.dst_proc){ *value = 0; }else{ - *value = -1; + if(act->comm.src_proc == NULL && act->comm.type == SIMIX_COMM_READY && act->comm.detached == 1) + *value = 0; + else + *value = -1; } procstate->state = MC_DONE; return &process->simcall;