#include <string>
#include <unordered_map>
-XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code, simgrid::mc::SimcallObserver* observer);
-XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code, simgrid::mc::SimcallObserver* observer);
+XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code,
+ simgrid::kernel::actor::SimcallObserver* observer);
+XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code,
+ simgrid::kernel::actor::SimcallObserver* observer);
namespace simgrid {
namespace kernel {
* you may need to wait for that mutex to be unlocked by its current owner.
* Potentially blocking simcall must be issued using simcall_blocking(), right below in this file.
*/
-template <class F> typename std::result_of_t<F()> simcall(F&& code, mc::SimcallObserver* observer = nullptr)
+template <class F> typename std::result_of_t<F()> simcall(F&& code, SimcallObserver* observer = nullptr)
{
// If we are in the maestro, we take the fast path and execute the
// code directly without simcall marshalling/unmarshalling/dispatch:
*
* The return value is obtained from observer->get_result() if it exists. Otherwise void is returned.
*/
-template <class F> void simcall_blocking(F&& code, mc::SimcallObserver* observer = nullptr)
+template <class F> void simcall_blocking(F&& code, SimcallObserver* observer = nullptr)
{
xbt_assert(not SIMIX_is_maestro(), "Cannot execute blocking call in kernel mode");
template <class F, class Observer>
auto simcall_blocking(F&& code, Observer* observer) -> decltype(observer->get_result())
{
- simcall_blocking(std::forward<F>(code), static_cast<mc::SimcallObserver*>(observer));
+ simcall_blocking(std::forward<F>(code), static_cast<SimcallObserver*>(observer));
return observer->get_result();
}
} // namespace actor