Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
factorize code between SIMIX_execution_start and SIMIX_execution_parallel_start
[simgrid.git] / src / kernel / activity / ExecImpl.cpp
index 8bfe3ce..259d5cb 100644 (file)
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
 
-simgrid::kernel::activity::ExecImpl::ExecImpl(const char* name, sg_host_t host) : host_(host)
+simgrid::kernel::activity::ExecImpl::ExecImpl(const char* name, resource::Action* surf_action,
+                                              resource::Action* timeout_detector, s4u::Host* host)
+    : host_(host)
 {
   if (name)
     this->name = name;
   this->state  = SIMIX_RUNNING;
+
+  surfAction_ = surf_action;
+  surfAction_->set_data(this);
+  if (timeout_detector != nullptr) {
+    timeout_detector->set_data(this);
+    timeoutDetector = timeout_detector;
+  }
+
   XBT_DEBUG("Create exec %p", this);
 }