From: Frederic Suter Date: Tue, 9 Mar 2021 15:50:46 +0000 (+0100) Subject: A canceled Activity is a completed Activity too X-Git-Tag: v3.27~195 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/93caa6f4e63a9cdd0e485585efd34afb0c9ff8c8 A canceled Activity is a completed Activity too --- diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 7267df2567..223cf5b22b 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -64,6 +64,7 @@ Exec* Exec::cancel() { kernel::actor::simcall([this] { boost::static_pointer_cast(pimpl_)->cancel(); }); state_ = State::CANCELED; + on_completion(*this); return this; } @@ -178,7 +179,6 @@ ExecPtr Exec::set_hosts(const std::vector& hosts) return this; } -///////////// SEQUENTIAL EXECUTIONS //////// Exec* Exec::start() { if (is_parallel()) @@ -236,6 +236,7 @@ double Exec::get_remaining_ratio() const } // namespace s4u } // namespace simgrid + /* **************************** Public C interface *************************** */ void sg_exec_set_bound(sg_exec_t exec, double bound) { diff --git a/src/s4u/s4u_Io.cpp b/src/s4u/s4u_Io.cpp index dd45f7aaad..926f269024 100644 --- a/src/s4u/s4u_Io.cpp +++ b/src/s4u/s4u_Io.cpp @@ -47,6 +47,7 @@ Io* Io::cancel() { simgrid::kernel::actor::simcall([this] { boost::static_pointer_cast(pimpl_)->cancel(); }); state_ = State::CANCELED; + on_completion(*this); return this; }