From: Martin Quinson Date: Tue, 8 Jan 2019 05:40:32 +0000 (+0100) Subject: Also test is_suspended in the s4u example X-Git-Tag: v3_22~654 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/98326ffd7251e584d828e07c35aaba26f48ff28e?ds=sidebyside Also test is_suspended in the s4u example --- diff --git a/examples/s4u/actor-suspend/s4u-actor-suspend.cpp b/examples/s4u/actor-suspend/s4u-actor-suspend.cpp index 57b7d0ce2b..d471ad75dc 100644 --- a/examples/s4u/actor-suspend/s4u-actor-suspend.cpp +++ b/examples/s4u/actor-suspend/s4u-actor-suspend.cpp @@ -36,7 +36,10 @@ static void dream_master() 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...");