Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use kernelImmediate for simcall cond_init.
[simgrid.git] / src / simix / libsmx.cpp
index d685e4b..15c75f6 100644 (file)
@@ -65,7 +65,9 @@ smx_activity_t simcall_execution_start(const char* name, double flops_amount, do
   xbt_assert(std::isfinite(flops_amount), "flops_amount is not finite!");
   xbt_assert(std::isfinite(priority), "priority is not finite!");
 
-  return simcall_BODY_execution_start(name, flops_amount, priority, bound, host);
+  return simgrid::simix::kernelImmediate([name, flops_amount, priority, bound, host] {
+    return SIMIX_execution_start(name, flops_amount, priority, bound, host);
+  });
 }
 
 /**
@@ -99,7 +101,9 @@ smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, s
 
   xbt_assert(std::isfinite(rate), "rate is not finite!");
 
-  return simcall_BODY_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
+  return simgrid::simix::kernelImmediate([name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout] {
+    return SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
+  });
 }
 
 /**
@@ -225,16 +229,6 @@ void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
   });
 }
 
-/**
- * \ingroup simix_process_management
- * \brief Add an on_exit function
- * Add an on_exit function which will be executed when the process exits/is killed.
- */
-XBT_PUBLIC void simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data)
-{
-  simcall_BODY_process_on_exit(process, fun, data);
-}
-
 /**
  * \ingroup simix_process_management
  * \brief Creates a new sleep SIMIX synchro.
@@ -399,7 +393,7 @@ void simcall_set_category(smx_activity_t synchro, const char *category)
   if (category == nullptr) {
     return;
   }
-  simcall_BODY_set_category(synchro, category);
+  simgrid::simix::kernelImmediate([synchro, category] { SIMIX_set_category(synchro, category); });
 }
 
 /**
@@ -457,7 +451,7 @@ void simcall_mutex_unlock(smx_mutex_t mutex)
  */
 smx_cond_t simcall_cond_init()
 {
-  return simcall_BODY_cond_init();
+  return simgrid::simix::kernelImmediate([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
 }
 
 /**