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
Sanitize the prototype of Actor::on_exit() callbacks
[simgrid.git]
/
teshsuite
/
s4u
/
pid
/
pid.cpp
diff --git
a/teshsuite/s4u/pid/pid.cpp
b/teshsuite/s4u/pid/pid.cpp
index
07b0f61
..
7fd0ac6
100644
(file)
--- a/
teshsuite/s4u/pid/pid.cpp
+++ b/
teshsuite/s4u/pid/pid.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009-201
8
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-201
9
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-7,18
+7,12
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example");
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example");
-static int my_onexit(smx_process_exit_status_t /*status*/, int* pid)
-{
- XBT_INFO("Process \"%d\" killed.", *pid);
- return 0;
-}
-
static void sendpid()
{
static void sendpid()
{
- simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by
N
ame("mailbox");
+ simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by
_n
ame("mailbox");
int pid = simgrid::s4u::this_actor::get_pid();
double comm_size = 100000;
int pid = simgrid::s4u::this_actor::get_pid();
double comm_size = 100000;
- simgrid::s4u::this_actor::on_exit(
(int_f_pvoid_pvoid_t)my_onexit, &pid
);
+ simgrid::s4u::this_actor::on_exit(
[pid](bool /*failed*/) { XBT_INFO("Process \"%d\" killed.", pid); }
);
XBT_INFO("Sending pid of \"%d\".", pid);
mailbox->put(&pid, comm_size);
XBT_INFO("Sending pid of \"%d\".", pid);
mailbox->put(&pid, comm_size);
@@
-29,7
+23,7
@@
static void sendpid()
static void killall()
{
static void killall()
{
- simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by
N
ame("mailbox");
+ simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by
_n
ame("mailbox");
for (int i = 0; i < 3; i++) {
int* pid = static_cast<int*>(mailbox->get());
XBT_INFO("Killing process \"%d\".", *pid);
for (int i = 0; i < 3; i++) {
int* pid = static_cast<int*>(mailbox->get());
XBT_INFO("Killing process \"%d\".", *pid);
@@
-40,7
+34,7
@@
static void killall()
int main(int argc, char* argv[])
{
simgrid::s4u::Engine e(&argc, argv);
int main(int argc, char* argv[])
{
simgrid::s4u::Engine e(&argc, argv);
- e.load
P
latform(argv[1]);
+ e.load
_p
latform(argv[1]);
simgrid::s4u::Actor::kill_all();
simgrid::s4u::Actor::kill_all();