kernel::actor::simcall([this, new_host]() {
if (pimpl_->waiting_synchro != nullptr) {
// The actor is blocked on an activity. If it's an exec, migrate it too.
- // FIXME: implement the migration of other kind of activities
+ // FIXME: implement the migration of other kinds of activities
kernel::activity::ExecImplPtr exec =
boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(pimpl_->waiting_synchro);
xbt_assert(exec.get() != nullptr, "We can only migrate blocked actors when they are blocked on executions.");
auto target = pimpl_;
s4u::Actor::on_suspend(*this);
kernel::actor::simcall_blocking<void>([issuer, target]() {
- target->suspend(issuer);
+ target->suspend();
if (target != issuer) {
/* If we are suspending ourselves, then just do not finish the simcall now */
issuer->simcall_answer();
void suspend()
{
- SIMIX_process_self()->iface()->suspend();
+ kernel::actor::ActorImpl* self = SIMIX_process_self();
+ s4u::Actor::on_suspend(*self->ciface());
+ kernel::actor::simcall_blocking<void>([self] { self->suspend(); });
}
void resume()
{
intrusive_ptr_release(actor);
}
+
+/** @brief Return the user data of a #sg_actor_t */
+void* sg_actor_data(sg_actor_t actor)
+{
+ return actor->get_data();
+}
+/** @brief Set the user data of a #sg_actor_t */
+void sg_actor_data_set(sg_actor_t actor, void* userdata)
+{
+ actor->set_data(userdata);
+}