From: Martin Quinson Date: Sun, 27 Feb 2022 14:42:04 +0000 (+0100) Subject: Revert "OOP is good, too" X-Git-Tag: v3.31~302 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ea25526ee1dda8f9d634e226b5f67d164e3bdc73?hp=016d020461cd4d21ea5a617d8f9099d47d7c880c Revert "OOP is good, too" This reverts commit f4925bd65c467da9862149984960de961af0d6cc, that breaks a java test (java_cloud_masterworker) in a way that is particularly hard to debug. The JVM is not exactly valgrind-friendly. Just do some small cosmetics in this area instead. --- diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index 1b89c8b545..817d2c1d73 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -207,7 +207,15 @@ void ActorImpl::exit() if (waiting_synchro_ != nullptr) { waiting_synchro_->cancel(); waiting_synchro_->set_state(activity::State::FAILED); - waiting_synchro_->post(); + + if (auto exec = boost::dynamic_pointer_cast(waiting_synchro_)) { + exec->clean_action(); + } else if (auto comm = boost::dynamic_pointer_cast(waiting_synchro_)) { + comm->unregister_simcall(&simcall_); + } else { + waiting_synchro_->finish(); + } + activities_.remove(waiting_synchro_); waiting_synchro_ = nullptr; }