A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
objectify simdata_task_t
[simgrid.git]
/
src
/
s4u
/
s4u_Activity.cpp
diff --git
a/src/s4u/s4u_Activity.cpp
b/src/s4u/s4u_Activity.cpp
index
9ef1d5f
..
2d3f344
100644
(file)
--- a/
src/s4u/s4u_Activity.cpp
+++ b/
src/s4u/s4u_Activity.cpp
@@
-1,5
+1,4
@@
-/* Copyright (c) 2006-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2019. 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. */
/* 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. */
@@
-8,6
+7,7
@@
#include "xbt/log.h"
#include "simgrid/s4u/Activity.hpp"
#include "xbt/log.h"
#include "simgrid/s4u/Activity.hpp"
+#include "simgrid/s4u/Engine.hpp"
XBT_LOG_EXTERNAL_CATEGORY(s4u);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_activity, s4u, "S4U activities");
XBT_LOG_EXTERNAL_CATEGORY(s4u);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_activity, s4u, "S4U activities");
@@
-15,6
+15,13
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_activity, s4u, "S4U activities");
namespace simgrid {
namespace s4u {
namespace simgrid {
namespace s4u {
+void Activity::wait_until(double time_limit)
+{
+ double now = Engine::get_clock();
+ if (time_limit > now)
+ wait_for(time_limit - now);
+}
+
double Activity::get_remaining()
{
return remains_;
double Activity::get_remaining()
{
return remains_;