From 9219b289b6c24093a7c36823319ddbc3f51dcebf Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Fri, 27 May 2016 15:42:37 +0200 Subject: [PATCH] a few more fixes --- examples/java/cloud/migration/TestHostOnOff.java | 1 - examples/java/process/kill/Killer.java | 5 +++-- examples/msg/async-waitany/async-waitany.c | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/java/cloud/migration/TestHostOnOff.java b/examples/java/cloud/migration/TestHostOnOff.java index d5cc52ba32..0ffa765148 100644 --- a/examples/java/cloud/migration/TestHostOnOff.java +++ b/examples/java/cloud/migration/TestHostOnOff.java @@ -23,7 +23,6 @@ public class TestHostOnOff extends Process{ super(host, name, args); } - @Override public void main(String[] strings) throws MsgException { /* get hosts 1 and 2*/ try { diff --git a/examples/java/process/kill/Killer.java b/examples/java/process/kill/Killer.java index 35c799073c..49bfc404a6 100644 --- a/examples/java/process/kill/Killer.java +++ b/examples/java/process/kill/Killer.java @@ -23,11 +23,12 @@ public class Killer extends Process { poorVictim = new Victim("Boivin","victim"); poorVictim.start(); } catch (MsgException e){ - System.out.println("Cannot create the victim process!"); + Msg.error("Cannot create the victim process!"); } sleep(10000); Msg.info("Resume Process"); - poorVictim.resume(); + if (poorVictim != null) + poorVictim.resume(); sleep(1000); Msg.info("Kill Process"); poorVictim.kill(); diff --git a/examples/msg/async-waitany/async-waitany.c b/examples/msg/async-waitany/async-waitany.c index d185701769..a1340c1167 100644 --- a/examples/msg/async-waitany/async-waitany.c +++ b/examples/msg/async-waitany/async-waitany.c @@ -44,13 +44,11 @@ static int sender(int argc, char *argv[]) xbt_dynar_free(&d); /* Here we are waiting for the completion of all tasks */ - sprintf(mailbox, "finalize"); - msg_comm_t res_irecv; XBT_ATTRIB_UNUSED msg_error_t res_wait; for (i = 0; i < receivers_count; i++) { task = NULL; - res_irecv = MSG_task_irecv(&(task), mailbox); + res_irecv = MSG_task_irecv(&(task), "finalize"); res_wait = MSG_comm_wait(res_irecv, -1); xbt_assert(res_wait == MSG_OK, "MSG_comm_wait failed"); MSG_comm_destroy(res_irecv); @@ -99,8 +97,7 @@ static int receiver(int argc, char *argv[]) xbt_free(task); /* Here we tell to sender that all tasks are done */ - sprintf(mailbox, "finalize"); - res_irecv = MSG_task_isend(MSG_task_create(NULL, 0, 0, NULL), mailbox); + res_irecv = MSG_task_isend(MSG_task_create(NULL, 0, 0, NULL), "finalize"); MSG_comm_wait(res_irecv, -1); MSG_comm_destroy(res_irecv); XBT_INFO("I'm done. See you!"); -- 2.20.1