Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the way IO activities are initiated
[simgrid.git] / src / s4u / s4u_Exec.cpp
index 704506a..31f69d2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -14,14 +14,19 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_exec, s4u_activity, "S4U asynchronous execut
 
 namespace simgrid {
 namespace s4u {
-xbt::signal<void(Exec const&, Actor const&)> Exec::on_start;
-xbt::signal<void(Exec const&, Actor const&)> Exec::on_completion;
+xbt::signal<void(Exec const&)> Exec::on_start;
+xbt::signal<void(Exec const&)> Exec::on_completion;
 
 Exec::Exec()
 {
   pimpl_ = kernel::activity::ExecImplPtr(new kernel::activity::ExecImpl());
 }
 
+ExecPtr Exec::init()
+{
+  return ExecPtr(new Exec());
+}
+
 Exec* Exec::wait()
 {
   return this->wait_for(-1);
@@ -35,7 +40,7 @@ Exec* Exec::wait_for(double timeout)
   kernel::actor::ActorImpl* issuer = Actor::self()->get_impl();
   kernel::actor::simcall_blocking<void>([this, issuer, timeout] { this->get_impl()->wait_for(issuer, timeout); });
   state_ = State::FINISHED;
-  on_completion(*this, *Actor::self());
+  on_completion(*this);
   this->release_dependencies();
   return this;
 }
@@ -185,7 +190,7 @@ Exec* Exec::start()
     pimpl_->suspend();
 
   state_ = State::STARTED;
-  on_start(*this, *Actor::self());
+  on_start(*this);
   return this;
 }