msg_actor = (simgrid::msg::ActorExt*)SIMIX_process_self_get_data();
SIMIX_process_self_set_data(nullptr);
} else {
- msg_actor = (simgrid::msg::ActorExt*)smx_actor->userdata;
+ msg_actor = (simgrid::msg::ActorExt*)smx_actor->getUserData();
simcall_process_set_data(smx_actor, nullptr);
}
xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
/* get from SIMIX the MSG process data, and then the user data */
- simgrid::msg::ActorExt* msgExt = (simgrid::msg::ActorExt*)process->get_impl()->userdata;
+ simgrid::msg::ActorExt* msgExt = (simgrid::msg::ActorExt*)process->get_impl()->getUserData();
if (msgExt)
return msgExt->data;
else
{
xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
- static_cast<simgrid::msg::ActorExt*>(process->get_impl()->userdata)->data = data;
+ static_cast<simgrid::msg::ActorExt*>(process->get_impl()->getUserData())->data = data;
return MSG_OK;
}
maestro = new simgrid::kernel::actor::ActorImpl();
maestro->pid = simix_process_maxpid++;
maestro->name = "";
- maestro->userdata = nullptr;
+ maestro->setUserData(nullptr);
if (not code) {
maestro->context = SIMIX_context_new(std::function<void()>(), nullptr, maestro);
process->pid = simix_process_maxpid++;
process->name = simgrid::xbt::string(name);
process->host = host;
- process->userdata = data;
+ process->setUserData(data);
process->simcall.issuer = process;
if (parent_process != nullptr) {
process->pid = simix_process_maxpid++;
process->name = std::string(name);
process->host = host;
- process->userdata = data;
+ process->setUserData(data);
process->simcall.issuer = process;
if (parent_process != nullptr) {
SIMIX_process_on_exit_runall(self);
/* Add the process to the list of process to restart, only if the host is down */
if (self->auto_restart && self->host->isOff()) {
- SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->userdata,
+ SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->getUserData(),
SIMIX_timer_get_date(self->kill_timer), self->getProperties(),
self->auto_restart);
}
smx_activity_t waiting_synchro = nullptr; /* the current blocking synchro if any */
std::list<smx_activity_t> comms; /* the current non-blocking communication synchros */
s_smx_simcall simcall;
- void* userdata = nullptr; /* kept for compatibility, it should be replaced with moddata */
std::vector<s_smx_process_exit_fun_t> on_exit; /* list of functions executed when the process dies */
std::function<void()> code;
smx_timer_t kill_timer = nullptr;
- /* Refcounting */
private:
+ void* userdata = nullptr; /* kept for compatibility, it should be replaced with moddata */
+ /* Refcounting */
std::atomic_int_fast32_t refcount_{0};
public:
ActorPtr me = Actor::self();
if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...)
return nullptr;
- simgrid::msg::ActorExt* msgExt = static_cast<simgrid::msg::ActorExt*>(me->get_impl()->userdata);
+ simgrid::msg::ActorExt* msgExt = static_cast<simgrid::msg::ActorExt*>(me->get_impl()->getUserData());
return static_cast<simgrid::smpi::Process*>(msgExt->data);
}
finalization_barrier_ = barrier;
process_ = simgrid::s4u::Actor::self();
- static_cast<simgrid::msg::ActorExt*>(process_->get_impl()->userdata)->data = this;
+ static_cast<simgrid::msg::ActorExt*>(process_->get_impl()->getUserData())->data = this;
if (*argc > 3) {
memmove(&(*argv)[0], &(*argv)[2], sizeof(char*) * (*argc - 2));