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
new: Actor::get_restart_count(): Returns the number of reboots that this actor did
[simgrid.git]
/
src
/
s4u
/
s4u_Actor.cpp
diff --git
a/src/s4u/s4u_Actor.cpp
b/src/s4u/s4u_Actor.cpp
index
ce00aaf
..
751f333
100644
(file)
--- a/
src/s4u/s4u_Actor.cpp
+++ b/
src/s4u/s4u_Actor.cpp
@@
-124,8
+124,11
@@
void Actor::join(double timeout) const
Actor* Actor::set_auto_restart(bool autorestart)
{
Actor* Actor::set_auto_restart(bool autorestart)
{
+ if (autorestart == pimpl_->has_to_auto_restart()) // not changed
+ return this;
+
kernel::actor::simcall_answered([this, autorestart]() {
kernel::actor::simcall_answered([this, autorestart]() {
- xbt_assert(autorestart
&& not pimpl_->has_to_auto_restart()); // FIXME: handle all cases
+ xbt_assert(autorestart
, "Asking an actor to stop being autorestart is not implemented yet. Ask us if you need it.");
pimpl_->set_auto_restart(autorestart);
auto* arg = new kernel::actor::ProcessArg(pimpl_->get_host(), pimpl_);
pimpl_->set_auto_restart(autorestart);
auto* arg = new kernel::actor::ProcessArg(pimpl_->get_host(), pimpl_);
@@
-134,6
+137,10
@@
Actor* Actor::set_auto_restart(bool autorestart)
});
return this;
}
});
return this;
}
+int Actor::get_restart_count()
+{
+ return pimpl_->get_restart_count();
+}
void Actor::on_exit(const std::function<void(bool /*failed*/)>& fun) const
{
void Actor::on_exit(const std::function<void(bool /*failed*/)>& fun) const
{