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);
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);
_XBT_GNUC_UNUSED int res;
int id = -1;
char mailbox[80];
- _XBT_GNUC_UNUSED int read;
- double duration, start, end;
+ double start, end;
sprintf(mailbox, "jupi");
while (1) {
continue;
}
- duration = MSG_task_get_compute_duration(task);
start = MSG_get_clock();
MSG_task_execute(task);
end = MSG_get_clock();