X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f4200e5d5322e9e2fef74725fb43c605876212d8..a10acf1eeceb5945d636e9210f2e0d39b235d49b:/examples/msg/process-kill/process-kill.c diff --git a/examples/msg/process-kill/process-kill.c b/examples/msg/process-kill/process-kill.c index f83b68a100..fe02ef8091 100644 --- a/examples/msg/process-kill/process-kill.c +++ b/examples/msg/process-kill/process-kill.c @@ -30,14 +30,15 @@ static int killer(int argc, char *argv[]) XBT_INFO("Kill process"); /* - and then kill it */ MSG_process_kill(poor_victim); - XBT_INFO("OK, goodbye now."); + XBT_INFO("OK, goodbye now. I commit a suicide."); + MSG_process_kill(MSG_process_self()); + + XBT_INFO("This line will never get displayed: I'm already dead since the previous line."); return 0; } int main(int argc, char *argv[]) { - msg_error_t res = MSG_OK; - MSG_init(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); @@ -45,7 +46,7 @@ int main(int argc, char *argv[]) /* - Create and deploy killer process, that will create the victim process */ MSG_process_create("killer", killer, NULL, MSG_host_by_name("Tremblay")); - res = MSG_main(); /* - Run the simulation */ + msg_error_t res = MSG_main(); /* - Run the simulation */ XBT_INFO("Simulation time %g", MSG_get_clock()); return res != MSG_OK;