X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fe0f39b4adfddf308e204c533ede55e74920919e..2e00e4aa073da6918d076cdb593248c8e01746e9:/examples/python/actor-suspend/actor-suspend.py diff --git a/examples/python/actor-suspend/actor-suspend.py b/examples/python/actor-suspend/actor-suspend.py index e3036edeac..e433b7f812 100644 --- a/examples/python/actor-suspend/actor-suspend.py +++ b/examples/python/actor-suspend/actor-suspend.py @@ -32,7 +32,10 @@ def dream_master(): this_actor.info("Let's wait a little bit...") this_actor.sleep_for(10) # Wait for 10 seconds this_actor.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: + this_actor.error("I was thinking that the lazy guy would be suspended now") this_actor.sleep_for(5) # Repeat two times: this_actor.info("Suspend the lazy guy while he's sleeping...")