Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix https://framagit.org/simgrid/simgrid/issues/30
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 10 Jul 2019 09:40:49 +0000 (11:40 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 10 Jul 2019 09:40:49 +0000 (11:40 +0200)
include/simgrid/actor.h
include/simgrid/msg.h
src/msg/msg_legacy.cpp
src/msg/msg_process.cpp
src/s4u/s4u_Actor.cpp

index f32860d..47d6622 100644 (file)
@@ -46,6 +46,8 @@ XBT_PUBLIC sg_actor_t sg_actor_self();
 XBT_PUBLIC aid_t sg_actor_self_get_pid();
 XBT_PUBLIC aid_t sg_actor_self_get_ppid();
 XBT_PUBLIC const char* sg_actor_self_get_name();
+XBT_PUBLIC void sg_actor_ref(sg_actor_t actor);
+XBT_PUBLIC void sg_actor_unref(sg_actor_t actor);
 
 SG_END_DECL()
 
index bbb438d..a1d5cec 100644 (file)
@@ -240,6 +240,8 @@ XBT_PUBLIC msg_process_t MSG_process_self();
 XBT_PUBLIC aid_t MSG_process_self_PID();
 XBT_PUBLIC aid_t MSG_process_self_PPID();
 XBT_PUBLIC const char* MSG_process_self_name();
+XBT_PUBLIC void MSG_process_ref(msg_process_t process);
+XBT_PUBLIC void MSG_process_unref(msg_process_t process);
 
 /** @brief Object representing an ongoing communication between processes.
  *
@@ -333,9 +335,6 @@ XBT_PUBLIC msg_error_t MSG_process_set_data(msg_process_t process, void* data);
 
 XBT_PUBLIC void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data);
 
-XBT_PUBLIC void MSG_process_ref(msg_process_t process);
-XBT_PUBLIC void MSG_process_unref(msg_process_t process);
-
 /************************** Task handling ************************************/
 XBT_PUBLIC msg_task_t MSG_task_create(const char* name, double flops_amount, double bytes_amount, void* data);
 XBT_PUBLIC msg_task_t MSG_parallel_task_create(const char* name, int host_nb, const msg_host_t* host_list,
index 31239fe..ab142c8 100644 (file)
@@ -172,6 +172,17 @@ msg_process_t MSG_process_self()
   return sg_actor_self();
 }
 
+/** @brief Take an extra reference on that process to prevent it to be garbage-collected */
+void MSG_process_ref(msg_process_t process)
+{
+  sg_actor_ref(process);
+}
+/** @brief Release a reference on that process so that it can get be garbage-collected */
+void MSG_process_unref(msg_process_t process)
+{
+  sg_actor_unref(process);
+}
+
 /* ************************** NetZones *************************** */
 sg_netzone_t MSG_zone_get_root()
 {
index cb98064..d6db894 100644 (file)
@@ -177,14 +177,3 @@ 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);
-}
index 26d0591..aa175c6 100644 (file)
@@ -688,3 +688,14 @@ sg_actor_t sg_actor_self()
 {
   return simgrid::s4u::Actor::self();
 }
+
+/** @brief Take an extra reference on that actor to prevent it to be garbage-collected */
+void sg_actor_ref(sg_actor_t actor)
+{
+  intrusive_ptr_add_ref(actor);
+}
+/** @brief Release a reference on that actor so that it can get be garbage-collected */
+void sg_actor_unref(sg_actor_t actor)
+{
+  intrusive_ptr_release(actor);
+}