- simgrid::kernel::actor::ActorImpl::detach();
-}
-
-smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostname,
- std::unordered_map<std::string, std::string>* properties,
- smx_actor_t /*parent_process*/) // deprecated 3.25
-{
- return simgrid::kernel::actor::ActorImpl::attach(name, data, sg_host_by_name(hostname), properties).get();
-}
-
-int SIMIX_process_count()
-{
- return simix_global->process_list.size();
-}
-
-void* SIMIX_process_self_get_data() // deprecated
-{
- smx_actor_t self = SIMIX_process_self();
-
- if (self == nullptr) {
- return nullptr;
- }
- return self->get_user_data();
-}
-
-void SIMIX_process_self_set_data(void* data) // deprecated
-{
- SIMIX_process_self()->set_user_data(data);
-}
-
-/* needs to be public and without simcall because it is called
- by exceptions and logging events */
-const char* SIMIX_process_self_get_name()
-{
-
- smx_actor_t process = SIMIX_process_self();
- if (process == nullptr || process == simix_global->maestro_process)
- return "maestro";
-
- return process->get_cname();
-}
-
-/**
- * @brief Calling this function makes the process to yield.
- *
- * Only the current process can call this function, giving back the control to maestro.
- *
- * @param self the current process
- */
-
-/** @brief Returns the list of processes to run.
- * @deprecated
- */
-const std::vector<smx_actor_t>& simgrid::simix::process_get_runnable()
-{
- return simix_global->actors_to_run;
-}
-
-/** @brief Returns the process from PID. */
-smx_actor_t SIMIX_process_from_PID(aid_t PID)
-{
- auto item = simix_global->process_list.find(PID);
- if (item == simix_global->process_list.end()) {
- for (auto& a : simix_global->actors_to_destroy)
- if (a.get_pid() == PID)
- return &a;
- return nullptr; // Not found, even in the trash
- }
- return item->second;
-}
-
-void SIMIX_process_on_exit(smx_actor_t actor, int_f_pvoid_pvoid_t fun, void* data)
-{
- SIMIX_process_on_exit(actor, [fun, data](bool failed) {
- intptr_t status = failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
- fun(reinterpret_cast<void*>(status), data);
- });
-}
-
-void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(int, void*)>& fun, void* data)
-{
- SIMIX_process_on_exit(actor, [fun, data](bool failed) { fun(failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS, data); });
-}
-
-void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(bool /*failed*/)>& fun)
-{
- xbt_assert(actor, "current process not found: are you in maestro context ?");
- actor->on_exit->emplace_back(fun);
-}
-
-/** @brief Restart a process, starting it again from the beginning. */
-/**
- * @ingroup simix_process_management
- * @brief Creates and runs a new SIMIX process.
- *
- * The structure and the corresponding thread are created and put in the list of ready processes.
- *
- * @param name a name for the process. It is for user-level information and can be nullptr.
- * @param code the main function of the process
- * @param data a pointer to any data one may want to attach to the new object. It is for user-level information and can
- * be nullptr.
- * It can be retrieved with the method ActorImpl::getUserData().
- * @param host where the new agent is executed.
- * @param properties the properties of the process
- */
-smx_actor_t simcall_process_create(const std::string& name, const simgrid::simix::ActorCode& code, void* data,
- sg_host_t host, std::unordered_map<std::string, std::string>* properties)
-{
- smx_actor_t self = SIMIX_process_self();
- return simgrid::kernel::actor::simcall([&name, &code, data, host, properties, self] {
- return simgrid::kernel::actor::ActorImpl::create(name, code, data, host, properties, self).get();
- });