+
+void simgrid::simix::Comm::cancel() {
+ /* if the synchro is a waiting state means that it is still in a mbox */
+ /* so remove from it and delete it */
+ if (state == SIMIX_WAITING) {
+ SIMIX_mbox_remove(mbox, this);
+ state = SIMIX_CANCELED;
+ }
+ else if (!MC_is_active() /* when running the MC there are no surf actions */
+ && !MC_record_replay_is_active()
+ && (state == SIMIX_READY || state == SIMIX_RUNNING)) {
+
+ surf_comm->cancel();
+ }
+}