X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b576eb1c0ab1acba1ceb0808b3708efe8a26dc1..ce930ad96b622e2b3856b7d9c3d97e60ec2c93a1:/src/s4u/s4u_Actor.cpp diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 9cfe9fa62d..7187920c3b 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -137,7 +137,7 @@ void Actor::migrate(Host* new_host) 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(pimpl_->waiting_synchro); xbt_assert(exec.get() != nullptr, "We can only migrate blocked actors when they are blocked on executions."); @@ -190,7 +190,7 @@ void Actor::suspend() auto target = pimpl_; s4u::Actor::on_suspend(*this); kernel::actor::simcall_blocking([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(); @@ -441,7 +441,9 @@ Host* get_host() void suspend() { - SIMIX_process_self()->iface()->suspend(); + kernel::actor::ActorImpl* self = SIMIX_process_self(); + s4u::Actor::on_suspend(*self->ciface()); + kernel::actor::simcall_blocking([self] { self->suspend(); }); } void resume() @@ -738,3 +740,14 @@ void sg_actor_unref(sg_actor_t actor) { 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); +}