X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/28cf1594ef109bb3cd215fd9b0f16a5418ca999e..8efeb3a6aa2c201800a3ba19416ea9728af3bff6:/src/simix/libsmx.cpp diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index d685e4bce3..3647e351e8 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -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(); }); } /** @@ -473,10 +467,10 @@ void simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex) * \ingroup simix_synchro_management * */ -void simcall_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) +int simcall_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) { xbt_assert(std::isfinite(timeout), "timeout is not finite!"); - simcall_BODY_cond_wait_timeout(cond, mutex, timeout); + return simcall_BODY_cond_wait_timeout(cond, mutex, timeout); } /** @@ -492,10 +486,10 @@ void simcall_sem_acquire(smx_sem_t sem) * \ingroup simix_synchro_management * */ -void simcall_sem_acquire_timeout(smx_sem_t sem, double timeout) +int simcall_sem_acquire_timeout(smx_sem_t sem, double timeout) { xbt_assert(std::isfinite(timeout), "timeout is not finite!"); - simcall_BODY_sem_acquire_timeout(sem, timeout); + return simcall_BODY_sem_acquire_timeout(sem, timeout); } sg_size_t simcall_storage_read(surf_storage_t st, sg_size_t size)