Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make actors_at_boot_ private
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 24 Oct 2019 16:43:58 +0000 (18:43 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 24 Oct 2019 16:43:58 +0000 (18:43 +0200)
src/s4u/s4u_Actor.cpp
src/surf/HostImpl.hpp
src/surf/sg_platf.cpp

index 5859a09..51bfd45 100644 (file)
@@ -115,8 +115,8 @@ void Actor::set_auto_restart(bool autorestart)
     pimpl_->set_auto_restart(autorestart);
 
     kernel::actor::ProcessArg* arg = new kernel::actor::ProcessArg(pimpl_->get_host(), pimpl_);
-    XBT_DEBUG("Adding Process %s to the actors_at_boot_ list of Host %s", arg->name.c_str(), arg->host->get_cname());
-    pimpl_->get_host()->pimpl_->actors_at_boot_.emplace_back(arg);
+    XBT_DEBUG("Adding %s to the actors_at_boot_ list of Host %s", arg->name.c_str(), arg->host->get_cname());
+    pimpl_->get_host()->pimpl_->add_actor_at_boot(arg);
   });
 }
 
index 474fc6e..fa0c5db 100644 (file)
@@ -43,6 +43,7 @@ public:
  * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage
  */
 class XBT_PRIVATE HostImpl : public simgrid::surf::PropertyHolder {
+  std::vector<kernel::actor::ProcessArg*> actors_at_boot_;
 
 public:
   friend simgrid::vm::VirtualMachineImpl;
@@ -67,6 +68,7 @@ public:
   size_t get_actor_count();
   void add_actor(kernel::actor::ActorImpl* actor) { actor_list_.push_back(*actor); }
   void remove_actor(kernel::actor::ActorImpl* actor) { xbt::intrusive_erase(actor_list_, *actor); }
+  void add_actor_at_boot(kernel::actor::ProcessArg* arg) { actors_at_boot_.emplace_back(arg); }
 
   typedef boost::intrusive::list<
       kernel::actor::ActorImpl,
@@ -76,7 +78,6 @@ public:
 
   // FIXME: make these private
   ActorList actor_list_;
-  std::vector<kernel::actor::ProcessArg*> actors_at_boot_;
 };
 }
 }
index 9f7b635..c86fbbb 100644 (file)
@@ -460,7 +460,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
   simgrid::kernel::actor::ProcessArg* arg =
       new simgrid::kernel::actor::ProcessArg(actor_name, code, nullptr, host, kill_time, properties, auto_restart);
 
-  host->pimpl_->actors_at_boot_.emplace_back(arg);
+  host->pimpl_->add_actor_at_boot(arg);
 
   if (start_time > SIMIX_get_clock()) {