Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Execute future callbacks in the main loop
[simgrid.git] / src / kernel / future.cpp
diff --git a/src/kernel/future.cpp b/src/kernel/future.cpp
new file mode 100644 (file)
index 0000000..4252161
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright (c) 2016. 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. */
+
+#include <xbt/functional.hpp>
+
+#include <simgrid/kernel/future.hpp>
+
+#include "src/simix/smx_private.h"
+
+namespace simgrid {
+namespace kernel {
+
+void FutureStateBase::schedule(simgrid::xbt::Task<void()>&& job)
+{
+  simix_global->tasks.push_back(std::move(job));
+}
+
+}
+}