From: Arnaud Giersch Date: Thu, 6 Mar 2014 11:56:54 +0000 (+0100) Subject: Wait for isends, and destroy comms. X-Git-Tag: v3_11~242^2~11 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/df54794d40fd920525d429df1913077a4beeb46a?hp=0b6f5de841baa5e0982e56a40cfd67f342517c1d Wait for isends, and destroy comms. --- diff --git a/teshsuite/msg/task_destroy_cancel.c b/teshsuite/msg/task_destroy_cancel.c index c9b17021b7..c71f9cbeff 100644 --- a/teshsuite/msg/task_destroy_cancel.c +++ b/teshsuite/msg/task_destroy_cancel.c @@ -27,6 +27,8 @@ int master(int argc, char *argv[]) char mailbox[256]; msg_task_t task = NULL; msg_comm_t comm = NULL; + xbt_ex_t ex; + sprintf(mailbox, "jupi"); task = MSG_task_create("normal", task_comp_size, task_comm_size, NULL); @@ -45,11 +47,25 @@ int master(int argc, char *argv[]) comm = MSG_task_isend(task, mailbox); XBT_INFO("Canceling task \"%s\" during comm", task->name); MSG_task_cancel(task); + TRY { + MSG_comm_wait(comm, -1); + } + CATCH (ex) { + xbt_ex_free(ex); + MSG_comm_destroy(comm); + } task = MSG_task_create("finalize", task_comp_size, task_comm_size, NULL); comm = MSG_task_isend(task, mailbox); XBT_INFO("Destroying task \"%s\" during comm", task->name); MSG_task_destroy(task); + TRY { + MSG_comm_wait(comm, -1); + } + CATCH (ex) { + xbt_ex_free(ex); + MSG_comm_destroy(comm); + } task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL); MSG_task_send_with_timeout(task, mailbox, timeout);