From: henricasanova Date: Thu, 6 Jul 2017 07:49:53 +0000 (+0200) Subject: Removed the "state_ != finished" assert in s4u::Comm::wait(...) since X-Git-Tag: v3_17~444^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6d14999afc8567368d13d1b1ad108ac9ddae32ae?hp=dceed88b84f4c8dccf94f8031cc9ba635eaf75da Removed the "state_ != finished" assert in s4u::Comm::wait(...) since waiting on a finished communication should be a feature, not a bug --- diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index 070f7d1076..9f4ad0b438 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -83,7 +83,10 @@ void Comm::start() { state_ = started; } void Comm::wait() { - xbt_assert(state_ == started || state_ == inited); + xbt_assert(state_ == started || state_ == inited || state_ == finished); + + if (state_ == finished) + return; if (state_ == started) simcall_comm_wait(pimpl_, -1/*timeout*/); @@ -103,7 +106,10 @@ void Comm::wait() { } void Comm::wait(double timeout) { - xbt_assert(state_ == started || state_ == inited); + xbt_assert(state_ == started || state_ == inited || state_ == finished); + + if (state_ == finished) + return; if (state_ == started) { simcall_comm_wait(pimpl_, timeout);