From 594b10a112b66208df1de4b26d65d93d601a128e Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 22 Feb 2019 11:03:56 +0100 Subject: [PATCH] Throw exception when comm was canceled. --- src/s4u/s4u_Comm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index 7eb4685229..c770e2ca8d 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -6,6 +6,7 @@ #include "src/msg/msg_private.hpp" #include "xbt/log.h" +#include "simgrid/Exception.hpp" #include "simgrid/s4u/Comm.hpp" #include "simgrid/s4u/Mailbox.hpp" @@ -168,7 +169,8 @@ Comm* Comm::wait_for(double timeout) return this; case State::CANCELED: - return this; + throw CancelException(XBT_THROW_POINT, "Communication canceled"); + default: THROW_IMPOSSIBLE; } -- 2.20.1