process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
/* Destroy any isend which correspond to completed communications */
- int found;
msg_comm_t comm;
- while ((found = MSG_comm_testany(globals->isends)) != -1) {
- xbt_dynar_remove_at(globals->isends, found, &comm);
+ while (1/*true*/) {
+ int pos_found = MSG_comm_testany(globals->isends);
+ if (pos_found == -1) /* none remaining */
+ break;
+ xbt_dynar_remove_at(globals->isends, pos_found, &comm);
MSG_comm_destroy(comm);
}
}
processes_arrived_sofar--;
if (processes_arrived_sofar<=0) {
- SIMIX_cond_destroy(cond);
- SIMIX_mutex_destroy(mutex);
+ SIMIX_cond_unref(cond);
+ SIMIX_mutex_unref(mutex);
mutex = NULL;
}
}