Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use TASK_CANCELED rather than HOST_FAILURE for CancelExeption
[simgrid.git] / src / msg / msg_gos.cpp
index 04a9e01..b81c975 100644 (file)
@@ -456,6 +456,9 @@ int MSG_comm_test(msg_comm_t comm)
   } catch (simgrid::TimeoutError& e) {
     comm->status = MSG_TIMEOUT;
     finished     = true;
+  } catch (simgrid::CancelException& e) {
+    comm->status = MSG_TASK_CANCELED;
+    finished     = true;
   }
   catch (xbt_ex& e) {
     if (e.category == network_error) {
@@ -495,6 +498,9 @@ int MSG_comm_testany(xbt_dynar_t comms)
   } catch (simgrid::TimeoutError& e) {
     finished_index = e.value;
     status         = MSG_TIMEOUT;
+  } catch (simgrid::CancelException& e) {
+    finished_index = e.value;
+    status         = MSG_TASK_CANCELED;
   }
   catch (xbt_ex& e) {
     if (e.category != network_error)
@@ -544,6 +550,8 @@ msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
     /* FIXME: these functions are not traceable */
   } catch (simgrid::TimeoutError& e) {
     comm->status = MSG_TIMEOUT;
+  } catch (simgrid::CancelException& e) {
+    comm->status = MSG_TASK_CANCELED;
   }
   catch (xbt_ex& e) {
     if (e.category == network_error)
@@ -591,6 +599,9 @@ int MSG_comm_waitany(xbt_dynar_t comms)
   } catch (simgrid::TimeoutError& e) {
     finished_index = e.value;
     status         = MSG_TIMEOUT;
+  } catch (simgrid::CancelException& e) {
+    finished_index = e.value;
+    status         = MSG_TASK_CANCELED;
   }
   catch(xbt_ex& e) {
     if (e.category == network_error) {