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
check that disk has been given as argument before accessing its pimpl
[simgrid.git]
/
src
/
s4u
/
s4u_Actor.cpp
diff --git
a/src/s4u/s4u_Actor.cpp
b/src/s4u/s4u_Actor.cpp
index
27b2dca
..
e4ec4be
100644
(file)
--- a/
src/s4u/s4u_Actor.cpp
+++ b/
src/s4u/s4u_Actor.cpp
@@
-110,15
+110,19
@@
void Actor::join(double timeout) const
{
kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
const kernel::actor::ActorImpl* target = pimpl_;
- kernel::actor::simcall_blocking([issuer, target, timeout] {
- if (target->wannadie()) {
- // The joined actor is already finished, just wake up the issuer right away
- issuer->simcall_answer();
- } else {
- kernel::activity::ActivityImplPtr sync = issuer->join(target, timeout);
- sync->register_simcall(&issuer->simcall_);
- }
- });
+ kernel::actor::ActorJoinSimcall observer{issuer, get_impl(), timeout};
+
+ kernel::actor::simcall_blocking(
+ [issuer, target, timeout] {
+ if (target->wannadie()) {
+ // The joined actor is already finished, just wake up the issuer right away
+ issuer->simcall_answer();
+ } else {
+ kernel::activity::ActivityImplPtr sync = issuer->join(target, timeout);
+ sync->register_simcall(&issuer->simcall_);
+ }
+ },
+ &observer);
}
Actor* Actor::set_auto_restart(bool autorestart)
@@
-250,7
+254,7
@@
void Actor::kill()
ActorPtr Actor::by_pid(aid_t pid)
{
- kernel::actor::ActorImpl* actor = kernel::
actor::ActorImpl::
by_pid(pid);
+ kernel::actor::ActorImpl* actor = kernel::
EngineImpl::get_instance()->get_actor_
by_pid(pid);
if (actor != nullptr)
return actor->get_iface();
else
@@
-585,8
+589,8
@@
xbt_dict_t sg_actor_get_properties(const_sg_actor_t actor)
const std::unordered_map<std::string, std::string>* props = actor->get_properties();
if (props == nullptr)
return nullptr;
- for (auto const&
kv
: *props) {
- xbt_dict_set(as_dict, k
v.first.c_str(), xbt_strdup(kv.second
.c_str()));
+ for (auto const&
[key, value]
: *props) {
+ xbt_dict_set(as_dict, k
ey.c_str(), xbt_strdup(value
.c_str()));
}
return as_dict;
}
@@
-720,7
+724,7
@@
sg_actor_t sg_actor_attach(const char* name, void* data, sg_host_t host, xbt_dic
xbt_dict_free(&properties);
/* Let's create the actor: SIMIX may decide to start it right now, even before returning the flow control to us */
- s
mx_actor_t
actor = nullptr;
+ s
imgrid::kernel::actor::ActorImpl*
actor = nullptr;
try {
actor = simgrid::kernel::actor::ActorImpl::attach(name, data, host).get();
actor->set_properties(props);