*/
template <class R, class F> R simcall_blocking(F&& code, mc::SimcallObserver* t = nullptr)
{
- // If we are in the maestro, we take the fast path and execute the
- // code directly without simcall marshalling/unmarshalling/dispatch:
- if (SIMIX_is_maestro())
- return std::forward<F>(code)();
+ xbt_assert(not SIMIX_is_maestro(), "Cannot execute blocking call in kernel mode");
// If we are in the application, pass the code to the maestro which
// executes it for us and reports the result. We use a std::future which
template <class F> auto kernel_sync(F code) -> decltype(code().get())
{
using T = decltype(code().get());
- if (SIMIX_is_maestro())
- xbt_die("Can't execute blocking call in kernel mode");
+ xbt_assert(not SIMIX_is_maestro(), "Cannot execute blocking call in kernel mode");
smx_actor_t self = SIMIX_process_self();
simgrid::xbt::Result<T> result;
-
simcall_run_blocking(
[&result, self, &code] {
try {