-/* Copyright (c) 2008-2013. The SimGrid Team.
+/* Copyright (c) 2008-2014. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
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];
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;