Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Throw exception when comm was canceled.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 22 Feb 2019 10:03:56 +0000 (11:03 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 22 Feb 2019 10:03:56 +0000 (11:03 +0100)
src/s4u/s4u_Comm.cpp

index 7eb4685..c770e2c 100644 (file)
@@ -6,6 +6,7 @@
 #include "src/msg/msg_private.hpp"
 #include "xbt/log.h"
 
 #include "src/msg/msg_private.hpp"
 #include "xbt/log.h"
 
+#include "simgrid/Exception.hpp"
 #include "simgrid/s4u/Comm.hpp"
 #include "simgrid/s4u/Mailbox.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;
 
     case State::CANCELED:
-      return this;
+      throw CancelException(XBT_THROW_POINT, "Communication canceled");
+
     default:
       THROW_IMPOSSIBLE;
   }
     default:
       THROW_IMPOSSIBLE;
   }