X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c1f8285532e05556132023a43ad53a5a5e6c2060..e318ce3cff3210f679cfd1b277bedd39444ccc62:/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp diff --git a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp index 5c22018489..ed572286ae 100644 --- a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp +++ b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp @@ -1,10 +1,9 @@ -/* Copyright (c) 2010-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include +#include "simgrid/Exception.hpp" #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); @@ -32,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);