From e318ce3cff3210f679cfd1b277bedd39444ccc62 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 22 Feb 2019 11:01:45 +0100 Subject: [PATCH] MSG is a C API and should not throw. --- .../msg/task_destroy_cancel/task_destroy_cancel.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp index 0a6cd714aa..ed572286ae 100644 --- a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp +++ b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp @@ -31,24 +31,16 @@ static int master(int /*argc*/, char* /*argv*/ []) msg_comm_t comm = MSG_task_isend(task, "worker_mailbox"); XBT_INFO("Canceling task \"%s\" during comm", task->name); MSG_task_cancel(task); - try { - MSG_comm_wait(comm, -1); - } - catch (xbt_ex& ex) { + if (MSG_comm_wait(comm, -1) != MSG_OK) MSG_comm_destroy(comm); - } MSG_task_destroy(task); task = MSG_task_create("finalize", task_comp_size, task_comm_size, NULL); comm = MSG_task_isend(task, "worker_mailbox"); XBT_INFO("Destroying task \"%s\" during comm", task->name); MSG_task_destroy(task); - try { - MSG_comm_wait(comm, -1); - } - catch (xbt_ex& ex) { + if (MSG_comm_wait(comm, -1) != MSG_OK) MSG_comm_destroy(comm); - } task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL); MSG_task_send_with_timeout(task, "worker_mailbox", timeout); -- 2.20.1