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
Update copyright lines.
[simgrid.git]
/
teshsuite
/
s4u
/
pid
/
pid.cpp
diff --git
a/teshsuite/s4u/pid/pid.cpp
b/teshsuite/s4u/pid/pid.cpp
index
9cf7848
..
7c2c7c0
100644
(file)
--- a/
teshsuite/s4u/pid/pid.cpp
+++ b/
teshsuite/s4u/pid/pid.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009-202
0
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-202
1
. 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. */
@@
-10,13
+10,13
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example")
static void sendpid()
{
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name("mailbox");
static void sendpid()
{
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name("mailbox");
-
int pid = static_cast<int>(simgrid::s4u::this_actor::get_pid()
);
+
aid_t pid = simgrid::s4u::this_actor::get_pid(
);
long comm_size = 100000;
long comm_size = 100000;
- simgrid::s4u::this_actor::on_exit([pid](bool /*failed*/) { XBT_INFO("Process \"%d\" killed.", pid); });
+ simgrid::s4u::this_actor::on_exit([pid](bool /*failed*/) { XBT_INFO("Process \"%
l
d\" killed.", pid); });
- XBT_INFO("Sending pid of \"%d\".", pid);
+ XBT_INFO("Sending pid of \"%
l
d\".", pid);
mailbox->put(&pid, comm_size);
mailbox->put(&pid, comm_size);
- XBT_INFO("Send of pid \"%d\" done.", pid);
+ XBT_INFO("Send of pid \"%
l
d\" done.", pid);
simgrid::s4u::this_actor::suspend();
}
simgrid::s4u::this_actor::suspend();
}
@@
-25,8
+25,8
@@
static void killall()
{
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name("mailbox");
for (int i = 0; i < 3; i++) {
{
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name("mailbox");
for (int i = 0; i < 3; i++) {
- const
int* pid = static_cast<int*>(mailbox->get()
);
- XBT_INFO("Killing process \"%d\".", *pid);
+ const
auto* pid = mailbox->get<aid_t>(
);
+ XBT_INFO("Killing process \"%
l
d\".", *pid);
simgrid::s4u::Actor::by_pid(*pid)->kill();
}
}
simgrid::s4u::Actor::by_pid(*pid)->kill();
}
}