X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ff3a4cf6e03165421f65616a22be86b8f528e21..98326ffd7251e584d828e07c35aaba26f48ff28e:/examples/s4u/actor-suspend/s4u-actor-suspend.cpp diff --git a/examples/s4u/actor-suspend/s4u-actor-suspend.cpp b/examples/s4u/actor-suspend/s4u-actor-suspend.cpp index e2b9c849e5..d471ad75dc 100644 --- a/examples/s4u/actor-suspend/s4u-actor-suspend.cpp +++ b/examples/s4u/actor-suspend/s4u-actor-suspend.cpp @@ -32,11 +32,14 @@ static void lazy_guy() static void dream_master() { XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */ - simgrid::s4u::ActorPtr lazy = simgrid::s4u::Actor::create("Lazy", simgrid::s4u::this_actor::getHost(), lazy_guy); + simgrid::s4u::ActorPtr lazy = simgrid::s4u::Actor::create("Lazy", simgrid::s4u::this_actor::get_host(), lazy_guy); XBT_INFO("Let's wait a little bit..."); simgrid::s4u::this_actor::sleep_for(10); /* - Wait for 10 seconds */ XBT_INFO("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!"); - lazy->resume(); /* - Then wake up the lazy_guy */ + if (lazy->is_suspended()) + lazy->resume(); /* - Then wake up the lazy_guy */ + else + XBT_ERROR("I was thinking that the lazy guy would be suspended now"); simgrid::s4u::this_actor::sleep_for(5); /* Repeat two times: */ XBT_INFO("Suspend the lazy guy while he's sleeping..."); @@ -69,8 +72,8 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); /* - Load the platform description */ - std::vector list = e.getAllHosts(); + e.load_platform(argv[1]); /* - Load the platform description */ + std::vector list = e.get_all_hosts(); simgrid::s4u::Actor::create("dream_master", list.front(), dream_master); e.run(); /* - Run the simulation */