X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ad9d9459261f6f55f69edc333689ad86f2a9f229..55092bf3f9fe1cccfe72f7ef81fcd51f9a0eb4ca:/src/simix/popping_bodies.cpp?ds=sidebyside diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index 5a5ef80273..191080887b 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -13,6 +13,7 @@ * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :) */ +#include #include "smx_private.h" #include "src/mc/mc_forward.hpp" #include "xbt/ex.h" @@ -220,10 +221,10 @@ inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_ return simcall(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); } -inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) { +inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) { /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall, comms); - return simcall(SIMCALL_COMM_WAITANY, comms); + if (0) simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall, comms, timeout); + return simcall(SIMCALL_COMM_WAITANY, comms, timeout); } inline static void simcall_BODY_comm_wait(smx_synchro_t comm, double timeout) { @@ -238,10 +239,10 @@ inline static int simcall_BODY_comm_test(smx_synchro_t comm) { return simcall(SIMCALL_COMM_TEST, comm); } -inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) { +inline static int simcall_BODY_comm_testany(smx_synchro_t* comms, size_t count) { /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms); - return simcall(SIMCALL_COMM_TESTANY, comms); + if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count); + return simcall(SIMCALL_COMM_TESTANY, comms, count); } inline static smx_mutex_t simcall_BODY_mutex_init() { @@ -436,8 +437,14 @@ inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* return simcall(SIMCALL_SET_CATEGORY, synchro, category); } -inline static void simcall_BODY_run_kernel(void* code) { +inline static void simcall_BODY_run_kernel(std::function const* code) { /* Go to that function to follow the code flow through the simcall barrier */ if (0) SIMIX_run_kernel(code); - return simcall(SIMCALL_RUN_KERNEL, code); + return simcall const*>(SIMCALL_RUN_KERNEL, code); + } + +inline static void simcall_BODY_run_blocking(std::function const* code) { + /* Go to that function to follow the code flow through the simcall barrier */ + if (0) SIMIX_run_blocking(code); + return simcall const*>(SIMCALL_RUN_BLOCKING, code); }/** @endcond */