X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1d047f5a110cfd542b0aedeb72f680e03f8709cd..5ed37babb2fa9097abe82df299c0aa259ed84d5a:/examples/python/actor-kill/actor-kill.py diff --git a/examples/python/actor-kill/actor-kill.py b/examples/python/actor-kill/actor-kill.py index b0dc721385..43960b9e9d 100644 --- a/examples/python/actor-kill/actor-kill.py +++ b/examples/python/actor-kill/actor-kill.py @@ -1,14 +1,18 @@ -# Copyright (c) 2017-2021. The SimGrid Team. All rights reserved. +# Copyright (c) 2017-2023. 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. -from simgrid import Actor, Engine, Host, this_actor +""" +Usage: actor-kill.py platform_file [other parameters] +""" + import sys +from simgrid import Actor, Engine, Host, this_actor def victim_a_fun(): - this_actor.on_exit(lambda: this_actor.info("I have been killed!")) + this_actor.on_exit(lambda forcefully: this_actor.info("I have been killed!" if forcefully else "I finish now.")) this_actor.info("Hello!") this_actor.info("Suspending myself") this_actor.suspend() # - Start by suspending itself