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
Factor Activity::cancel() through CRTP.
[simgrid.git]
/
src
/
s4u
/
s4u_Activity.cpp
diff --git
a/src/s4u/s4u_Activity.cpp
b/src/s4u/s4u_Activity.cpp
index
002035c
..
00b3ff4
100644
(file)
--- a/
src/s4u/s4u_Activity.cpp
+++ b/
src/s4u/s4u_Activity.cpp
@@
-41,6
+41,13
@@
bool Activity::test()
return false;
}
+Activity* Activity::cancel()
+{
+ kernel::actor::simcall([this] { pimpl_->cancel(); });
+ complete(State::CANCELED);
+ return this;
+}
+
Activity* Activity::suspend()
{
if (suspended_)