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
useless cosmetic commit
[simgrid.git]
/
examples
/
c
/
actor-join
/
actor-join.c
diff --git
a/examples/c/actor-join/actor-join.c
b/examples/c/actor-join/actor-join.c
index
1f26270
..
83ab59c
100644
(file)
--- a/
examples/c/actor-join/actor-join.c
+++ b/
examples/c/actor-join/actor-join.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010-202
0
. The SimGrid Team.
+/* Copyright (c) 2010-202
1
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-13,38
+13,34
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(actor_join, "Messages specific for this example");
XBT_LOG_NEW_DEFAULT_CATEGORY(actor_join, "Messages specific for this example");
-static void sleeper(
XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED
char* argv[])
+static void sleeper(
int argc,
char* argv[])
{
XBT_INFO("Sleeper started");
sg_actor_sleep_for(3);
XBT_INFO("I'm done. See you!");
}
{
XBT_INFO("Sleeper started");
sg_actor_sleep_for(3);
XBT_INFO("I'm done. See you!");
}
-static void master(
XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED
char* argv[])
+static void master(
int argc,
char* argv[])
{
{
- sg_actor_t actor;
+
const_
sg_actor_t actor;
XBT_INFO("Start sleeper");
XBT_INFO("Start sleeper");
- actor = sg_actor_init("sleeper from master", sg_host_self());
- sg_actor_start(actor, sleeper, 0, NULL);
+ actor = sg_actor_create("sleeper from master", sg_host_self(), sleeper, 0, NULL);
XBT_INFO("Join the sleeper (timeout 2)");
sg_actor_join(actor, 2);
XBT_INFO("Start sleeper");
XBT_INFO("Join the sleeper (timeout 2)");
sg_actor_join(actor, 2);
XBT_INFO("Start sleeper");
- actor = sg_actor_init("sleeper from master", sg_host_self());
- sg_actor_start(actor, sleeper, 0, NULL);
+ actor = sg_actor_create("sleeper from master", sg_host_self(), sleeper, 0, NULL);
XBT_INFO("Join the sleeper (timeout 4)");
sg_actor_join(actor, 4);
XBT_INFO("Start sleeper");
XBT_INFO("Join the sleeper (timeout 4)");
sg_actor_join(actor, 4);
XBT_INFO("Start sleeper");
- actor = sg_actor_init("sleeper from master", sg_host_self());
- sg_actor_start(actor, sleeper, 0, NULL);
+ actor = sg_actor_create("sleeper from master", sg_host_self(), sleeper, 0, NULL);
XBT_INFO("Join the sleeper (timeout 2)");
sg_actor_join(actor, 2);
XBT_INFO("Start sleeper");
XBT_INFO("Join the sleeper (timeout 2)");
sg_actor_join(actor, 2);
XBT_INFO("Start sleeper");
- actor = sg_actor_init("sleeper from master", sg_host_self());
- sg_actor_start(actor, sleeper, 0, NULL);
+ actor = sg_actor_create("sleeper from master", sg_host_self(), sleeper, 0, NULL);
sg_actor_ref(actor); // We have to take that ref because the actor will stop before we join it
XBT_INFO("Waiting 4");
sg_actor_sleep_for(4);
sg_actor_ref(actor); // We have to take that ref because the actor will stop before we join it
XBT_INFO("Waiting 4");
sg_actor_sleep_for(4);
@@
-62,12
+58,11
@@
static void master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
int main(int argc, char* argv[])
{
simgrid_init(&argc, argv);
int main(int argc, char* argv[])
{
simgrid_init(&argc, argv);
- xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s
msg_
platform.xml\n", argv[0], argv[0]);
+ xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s platform.xml\n", argv[0], argv[0]);
simgrid_load_platform(argv[1]);
simgrid_load_platform(argv[1]);
- sg_actor_t actor = sg_actor_init("master", sg_host_by_name("Tremblay"));
- sg_actor_start(actor, master, 0, NULL);
+ sg_actor_create("master", sg_host_by_name("Tremblay"), master, 0, NULL);
simgrid_run();
simgrid_run();