Maybe this can be dropped immediately?.
#endif
/************************** MC simcalls **********************************/
SG_BEGIN_DECL
-XBT_PUBLIC int simcall_mc_random(int min, int max);
+XBT_ATTRIB_DEPRECATED_v331("Please use MC_random") XBT_PUBLIC int simcall_mc_random(int min, int max);
SG_END_DECL
#endif
#if SIMGRID_HAVE_MC
xbt_assert(mc_model_checker == nullptr);
#endif
- /* TODO, if the MC is disabled we do not really need to make a simcall for this :) */
- return simcall_mc_random(min, max);
+ if (not MC_is_active() && not MC_record_replay_is_active()) { // no need to do a simcall in this case
+ static simgrid::xbt::random::XbtRandom prng;
+ return prng.uniform_int(min, max);
+ }
+ auto observer = new simgrid::mc::RandomSimcall(SIMIX_process_self(), min, max);
+ return simgrid::kernel::actor::simcall([observer] { return observer->get_value(); }, observer);
}
namespace simgrid {
simcall_BODY_run_blocking(&code);
}
-int simcall_mc_random(int min, int max) {
- if (not MC_is_active() && not MC_record_replay_is_active()) { // no need to do a simcall in this case
- static simgrid::xbt::random::XbtRandom prng;
- return prng.uniform_int(min, max);
- }
- auto observer = new simgrid::mc::RandomSimcall(SIMIX_process_self(), min, max);
- return simgrid::kernel::actor::simcall([observer] { return observer->get_value(); }, observer);
+int simcall_mc_random(int min, int max) // XBT_ATTRIB_DEPRECATD_v331
+{
+ return MC_random(min, max);
}
/* ************************************************************************** */