Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simcall_execution_destroy() -> simgrid::simix::Exec::unref()
[simgrid.git] / src / simix / SynchroExec.cpp
index db79ea0..02ce125 100644 (file)
@@ -17,3 +17,23 @@ void simgrid::simix::Exec::resume()
   if (surf_exec)
     surf_exec->resume();
 }
+
+double simgrid::simix::Exec::remains()
+{
+  if (state == SIMIX_RUNNING)
+    return surf_exec->getRemains();
+
+  return 0;
+}
+
+void simgrid::simix::Exec::unref()
+{
+  refcount--;
+  if (refcount > 0)
+    return;
+
+  if (surf_exec)
+    surf_exec->unref();
+
+  delete this;
+}