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
Merge branch 'master' into 'master'
[simgrid.git]
/
src
/
s4u
/
s4u_Actor.cpp
diff --git
a/src/s4u/s4u_Actor.cpp
b/src/s4u/s4u_Actor.cpp
index
1840dfe
..
7187920
100644
(file)
--- a/
src/s4u/s4u_Actor.cpp
+++ b/
src/s4u/s4u_Actor.cpp
@@
-97,7
+97,7
@@
void Actor::join(double timeout)
{
auto issuer = SIMIX_process_self();
auto target = pimpl_;
- kernel::actor::simcall_blocking([issuer, target, timeout] {
+ kernel::actor::simcall_blocking
<void>
([issuer, target, timeout] {
if (target->finished_) {
// The joined process is already finished, just wake up the issuer right away
issuer->simcall_answer();
@@
-137,7
+137,7
@@
void Actor::migrate(Host* new_host)
kernel::actor::simcall([this, new_host]() {
if (pimpl_->waiting_synchro != nullptr) {
// The actor is blocked on an activity. If it's an exec, migrate it too.
- // FIXME: implement the migration of other kind of activities
+ // FIXME: implement the migration of other kind
s
of activities
kernel::activity::ExecImplPtr exec =
boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(pimpl_->waiting_synchro);
xbt_assert(exec.get() != nullptr, "We can only migrate blocked actors when they are blocked on executions.");
@@
-189,8
+189,8
@@
void Actor::suspend()
auto issuer = SIMIX_process_self();
auto target = pimpl_;
s4u::Actor::on_suspend(*this);
- kernel::actor::simcall_blocking([issuer, target]() {
- target->suspend(
issuer
);
+ kernel::actor::simcall_blocking
<void>
([issuer, target]() {
+ target->suspend();
if (target != issuer) {
/* If we are suspending ourselves, then just do not finish the simcall now */
issuer->simcall_answer();
@@
-307,7
+307,7
@@
void sleep_for(double duration)
kernel::actor::ActorImpl* issuer = SIMIX_process_self();
Actor::on_sleep(*issuer->ciface());
- kernel::actor::simcall_blocking([issuer, duration]() {
+ kernel::actor::simcall_blocking
<void>
([issuer, duration]() {
if (MC_is_active() || MC_record_replay_is_active()) {
MC_process_clock_add(issuer, duration);
issuer->simcall_answer();
@@
-441,7
+441,9
@@
Host* get_host()
void suspend()
{
- SIMIX_process_self()->iface()->suspend();
+ kernel::actor::ActorImpl* self = SIMIX_process_self();
+ s4u::Actor::on_suspend(*self->ciface());
+ kernel::actor::simcall_blocking<void>([self] { self->suspend(); });
}
void resume()
@@
-738,3
+740,14
@@
void sg_actor_unref(sg_actor_t actor)
{
intrusive_ptr_release(actor);
}
+
+/** @brief Return the user data of a #sg_actor_t */
+void* sg_actor_data(sg_actor_t actor)
+{
+ return actor->get_data();
+}
+/** @brief Set the user data of a #sg_actor_t */
+void sg_actor_data_set(sg_actor_t actor, void* userdata)
+{
+ actor->set_data(userdata);
+}