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
remove a teshsuite example that is superseeded by a proper example
[simgrid.git]
/
examples
/
s4u
/
actor-create
/
s4u_actor-create.cpp
diff --git
a/examples/s4u/actor-create/s4u_actor-create.cpp
b/examples/s4u/actor-create/s4u_actor-create.cpp
index
a20f02e
..
0d72402
100644
(file)
--- a/
examples/s4u/actor-create/s4u_actor-create.cpp
+++ b/
examples/s4u/actor-create/s4u_actor-create.cpp
@@
-42,7
+42,7
@@
public:
XBT_INFO("Hello s4u, I have something to send");
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mb42");
XBT_INFO("Hello s4u, I have something to send");
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mb42");
-
simgrid::s4u::this_actor::send(mailbox,
xbt_strdup(msg.c_str()), msg.size());
+
mailbox->put(
xbt_strdup(msg.c_str()), msg.size());
XBT_INFO("I'm done. See you.");
}
};
XBT_INFO("I'm done. See you.");
}
};
@@
-72,11
+72,13
@@
public:
}
void operator()()
{
}
void operator()()
{
- XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->
n
ame());
+ XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->
getN
ame());
- char* msg1 = static_cast<char*>(
simgrid::s4u::this_actor::recv(mailbox
));
- char* msg2 = static_cast<char*>(
simgrid::s4u::this_actor::recv(mailbox
));
+ char* msg1 = static_cast<char*>(
mailbox->get(
));
+ char* msg2 = static_cast<char*>(
mailbox->get(
));
XBT_INFO("I received '%s' and '%s'", msg1, msg2);
XBT_INFO("I received '%s' and '%s'", msg1, msg2);
+ xbt_free(msg1);
+ xbt_free(msg2);
XBT_INFO("I'm done. See you.");
}
};
XBT_INFO("I'm done. See you.");
}
};
@@
-112,5
+114,7
@@
int main(int argc, char** argv)
e->run();
/* Once the simulation is done, the program is ended */
e->run();
/* Once the simulation is done, the program is ended */
+ delete e;
+
return 0;
}
return 0;
}