}
void operator()()
{
+ simgrid::s4u::ActorPtr actor;
for (int i = 0; i < number_of_yields; i++)
- simgrid::simix::kernelImmediate([] { /* do nothing*/ });
+ actor->yield();
XBT_INFO("I yielded %ld times. Goodbye now!", number_of_yields);
}
};
/** Resume a suspended process by resuming the task on which it was waiting for the completion. */
void resume();
+ void yield();
+
/** Returns true if the process is suspended. */
int isSuspended();
/** @brief Resume the actor. */
XBT_PUBLIC(void) resume();
+ XBT_PUBLIC(void) yield();
+
XBT_PUBLIC(bool) isSuspended();
/** @brief kill the actor. */
return simgrid::simix::kernelImmediate([this] { return pimpl_->suspended; });
}
+void Actor::yield()
+{
+ simgrid::simix::kernelImmediate([] { /* do nothing*/ });
+}
+
void Actor::setKillTime(double time) {
simcall_process_set_kill_time(pimpl_,time);
}