]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/activity/ActivityImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill some remains of the pre-C++ era
[simgrid.git] / src / kernel / activity / ActivityImpl.cpp
index ed1f237f6962b99d48b97ba4440c6d028029bf98..96d19d8e61eb0a767b040e8bc456b3bed3078562 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
-#include "src/kernel/activity/SynchroRaw.hpp"
+#include "src/kernel/activity/Synchro.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
 #include "src/kernel/actor/SimcallObserver.hpp"
 #include "src/kernel/resource/CpuImpl.hpp"
@@ -111,8 +111,7 @@ void ActivityImpl::wait_for(actor::ActorImpl* issuer, double timeout)
   } else {
     /* we need a sleep action (even when the timeout is infinite) to be notified of host failures */
     /* Comms handle that a bit differently of the other activities */
-    auto* comm = dynamic_cast<CommImpl*>(this);
-    if (comm != nullptr) {
+    if (auto* comm = dynamic_cast<CommImpl*>(this)) {
       resource::Action* sleep = issuer->get_host()->get_cpu()->sleep(timeout);
       sleep->set_activity(comm);
 
@@ -121,7 +120,7 @@ void ActivityImpl::wait_for(actor::ActorImpl* issuer, double timeout)
       else
         comm->dst_timeout_ = sleep;
     } else {
-      RawImplPtr synchro(new RawImpl([this, issuer]() {
+      SynchroImplPtr synchro(new SynchroImpl([this, issuer]() {
         this->unregister_simcall(&issuer->simcall_);
         issuer->waiting_synchro_ = nullptr;
         issuer->exception_       = nullptr;
@@ -219,7 +218,6 @@ void ActivityImpl::handle_activity_waitany(smx_simcall_t simcall)
     if (not MC_is_active() && not MC_record_replay_is_active()) {
       auto element   = std::find(activities.begin(), activities.end(), this);
       int rank       = element != activities.end() ? static_cast<int>(std::distance(activities.begin(), element)) : -1;
-      auto* observer = dynamic_cast<kernel::actor::ActivityWaitanySimcall*>(simcall->observer_);
       observer->set_result(rank);
     }
   }