-
-/** @brief returns a list of all currently existing processes */
-xbt_dynar_t MSG_processes_as_dynar() {
- xbt_dynar_t res = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
- for (auto const& kv : simix_global->process_list) {
- smx_actor_t actor = kv.second;
- xbt_dynar_push(res, &actor);
- }
- return res;
-}
-
-/** @brief Return the current number MSG processes. */
-int MSG_process_get_number()
-{
- return SIMIX_process_count();
-}
-
-/** @brief Add a function to the list of "on_exit" functions for the current process.
- * The on_exit functions are the functions executed when your process is killed.
- * You should use them to free the data used by your process.
- */
-void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data)
-{
- simgrid::s4u::this_actor::on_exit(
- [fun, data](bool failed) { fun(failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS, data); });
-}
-
-/** @brief Take an extra reference on that process to prevent it to be garbage-collected */
-XBT_PUBLIC void MSG_process_ref(msg_process_t process)
-{
- intrusive_ptr_add_ref(process);
-}
-/** @brief Release a reference on that process so that it can get be garbage-collected */
-XBT_PUBLIC void MSG_process_unref(msg_process_t process)
-{
- intrusive_ptr_release(process);
-}