#include <pybind11/stl.h>
#include "src/kernel/context/Context.hpp"
+#include <simgrid/Exception.hpp>
#include <simgrid/s4u/Actor.hpp>
#include <simgrid/s4u/Engine.hpp>
#include <simgrid/s4u/Host.hpp>
m.attr("simgrid_version") = simgrid_version;
// Internal exception used to kill actors and sweep the RAII chimney (free objects living on the stack)
- py::object pyForcefulKillEx =
- py::register_exception<simgrid::kernel::context::ForcefulKillException>(m, "ActorKilled");
+ py::object pyForcefulKillEx = py::register_exception<simgrid::ForcefulKillException>(m, "ActorKilled");
/* this_actor namespace */
void (*sleep_for_fun)(double) = &simgrid::s4u::this_actor::sleep_for; // pick the right overload
m2.def("on_exit",
[](py::object fun) {
ActorPtr act = Actor::self();
- simgrid::s4u::this_actor::on_exit(
- [act, fun](int /*ignored*/, void* /*data*/) {
- try {
- fun();
- } catch (py::error_already_set& e) {
- xbt_die("Error while executing the on_exit lambda: %s", e.what());
- }
- },
- nullptr);
+ simgrid::s4u::this_actor::on_exit([act, fun](bool /*failed*/) {
+ try {
+ fun();
+ } catch (py::error_already_set& e) {
+ xbt_die("Error while executing the on_exit lambda: %s", e.what());
+ }
+ });
},
"");