X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d918db3ca7152c00113f2e072deca4614f97bb58..a5ebe49265afa41c01e8386c47a1a94a136288d9:/include/simgrid/simix/blocking_simcall.hpp diff --git a/include/simgrid/simix/blocking_simcall.hpp b/include/simgrid/simix/blocking_simcall.hpp index fd9797f9d8..7a80fe5d05 100644 --- a/include/simgrid/simix/blocking_simcall.hpp +++ b/include/simgrid/simix/blocking_simcall.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2016-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -13,10 +13,10 @@ #include -#include #include #include #include +#include namespace simgrid { namespace simix { @@ -46,12 +46,10 @@ XBT_PUBLIC void unblock(smx_actor_t process); template 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 result; - simcall_run_blocking( [&result, self, &code] { try { @@ -70,11 +68,12 @@ template auto kernel_sync(F code) -> decltype(code().get()) } /** A blocking (`wait()`-based) future for SIMIX processes */ -// TODO, .wait_for -// TODO, .wait_until -// TODO, SharedFuture -// TODO, simgrid::simix::when_all - wait for all future to be ready (this one is simple!) -// TODO, simgrid::simix::when_any - wait for any future to be ready +// TODO: +// - .wait_for +// - .wait_until +// - SharedFuture +// - simgrid::simix::when_all - wait for all future to be ready (this one is simple!) +// - simgrid::simix::when_any - wait for any future to be ready template class Future { public: