namespace kernel {
namespace activity {
-SleepImpl* SleepImpl::start(double duration)
+SleepImpl& SleepImpl::set_host(s4u::Host* host)
{
- surf_action_ = host_->pimpl_cpu->sleep(duration);
+ host_ = host;
+ return *this;
+}
+
+SleepImpl& SleepImpl::set_duration(double duration)
+{
+ duration_ = duration;
+ return *this;
+}
+
+SleepImpl* SleepImpl::start()
+{
+ surf_action_ = host_->pimpl_cpu->sleep(duration_);
surf_action_->set_data(this);
XBT_DEBUG("Create sleep synchronization %p", this);
return this;
SIMIX_simcall_answer(simcall);
}
}
-
SIMIX_process_sleep_destroy(this);
}
void SleepImpl::finish()