/* destroy the blocking synchro if any */
if (waiting_synchro != nullptr) {
+ waiting_synchro->cancel();
+ waiting_synchro->state_ = SIMIX_FAILED;
activity::ExecImplPtr exec = boost::dynamic_pointer_cast<activity::ExecImpl>(waiting_synchro);
activity::CommImplPtr comm = boost::dynamic_pointer_cast<activity::CommImpl>(waiting_synchro);
- activity::SleepImplPtr sleep = boost::dynamic_pointer_cast<activity::SleepImpl>(waiting_synchro);
- activity::RawImplPtr raw = boost::dynamic_pointer_cast<activity::RawImpl>(waiting_synchro);
- activity::IoImplPtr io = boost::dynamic_pointer_cast<activity::IoImpl>(waiting_synchro);
- if (exec != nullptr && exec->surf_action_) {
- exec->cancel();
+ if (exec != nullptr) {
exec->clean_action();
} else if (comm != nullptr) {
comms.remove(waiting_synchro);
- comm->cancel();
// Remove first occurrence of &actor->simcall:
auto i = boost::range::find(waiting_synchro->simcalls_, &simcall);
if (i != waiting_synchro->simcalls_.end())
waiting_synchro->simcalls_.remove(&simcall);
- } else if (sleep != nullptr) {
- sleep->cancel();
- sleep->post();
- } else if (raw != nullptr) {
- raw->finish();
- } else if (io != nullptr) {
- io->cancel();
} else {
- simgrid::kernel::activity::ActivityImplPtr activity = waiting_synchro;
- xbt_die("Activity is of unknown type %s", simgrid::xbt::demangle(typeid(activity).name()).get());
+ activity::ActivityImplPtr(waiting_synchro)->finish();
}
waiting_synchro = nullptr;
/* cancel the blocking synchro if any */
if (waiting_synchro) {
-
- activity::ExecImplPtr exec = boost::dynamic_pointer_cast<activity::ExecImpl>(waiting_synchro);
- if (exec != nullptr)
- exec->cancel();
+ waiting_synchro->cancel();
activity::CommImplPtr comm = boost::dynamic_pointer_cast<activity::CommImpl>(waiting_synchro);
+ activity::SleepImplPtr sleep = boost::dynamic_pointer_cast<activity::SleepImpl>(waiting_synchro);
+
if (comm != nullptr) {
comms.remove(comm);
- comm->cancel();
}
- activity::SleepImplPtr sleep = boost::dynamic_pointer_cast<activity::SleepImpl>(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()) {
simix_global->actors_to_run.push_back(this);
}
}
-
- activity::RawImplPtr raw = boost::dynamic_pointer_cast<activity::RawImpl>(waiting_synchro);
- if (raw != nullptr) {
- raw->finish();
- }
-
- activity::IoImplPtr io = boost::dynamic_pointer_cast<activity::IoImpl>(waiting_synchro);
- if (io != nullptr) {
- io->cancel();
- }
}
+
waiting_synchro = nullptr;
}