From: Frederic Suter Date: Mon, 8 Apr 2019 11:09:46 +0000 (+0200) Subject: simplify throw_exception X-Git-Tag: v3.22.2~160 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5d923cc54672d126f8641229a698f7181b424825?hp=cce2f17588840ed67dae9c17507fe5957f87b85a simplify throw_exception --- diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index ee02c16871..5cea62caab 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -413,20 +413,16 @@ void ActorImpl::throw_exception(std::exception_ptr e) /* cancel the blocking synchro if any */ if (waiting_synchro) { - - activity::ExecImplPtr exec = boost::dynamic_pointer_cast(waiting_synchro); - if (exec != nullptr) - exec->cancel(); + waiting_synchro->cancel(); activity::CommImplPtr comm = boost::dynamic_pointer_cast(waiting_synchro); + activity::SleepImplPtr sleep = boost::dynamic_pointer_cast(waiting_synchro); + if (comm != nullptr) { comms.remove(comm); - comm->cancel(); } - activity::SleepImplPtr sleep = boost::dynamic_pointer_cast(waiting_synchro); if (sleep != nullptr) { - sleep->clean_action(); if (std::find(begin(simix_global->actors_to_run), end(simix_global->actors_to_run), this) == end(simix_global->actors_to_run) && this != SIMIX_process_self()) { @@ -434,17 +430,8 @@ void ActorImpl::throw_exception(std::exception_ptr e) simix_global->actors_to_run.push_back(this); } } - - activity::RawImplPtr raw = boost::dynamic_pointer_cast(waiting_synchro); - if (raw != nullptr) { - raw->finish(); - } - - activity::IoImplPtr io = boost::dynamic_pointer_cast(waiting_synchro); - if (io != nullptr) { - io->cancel(); - } } + waiting_synchro = nullptr; }