From: Martin Quinson Date: Fri, 27 Apr 2012 10:01:24 +0000 (+0200) Subject: remove the now useless Process.ifInterruptedStop() X-Git-Tag: v3_9_90~569^2~19^2~122 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9d45f09800ba18cc02555b9d40ad6f5090eaa8a4 remove the now useless Process.ifInterruptedStop() --- diff --git a/org/simgrid/msg/Host.java b/org/simgrid/msg/Host.java index e5548b9e82..186a0ab00c 100644 --- a/org/simgrid/msg/Host.java +++ b/org/simgrid/msg/Host.java @@ -76,7 +76,6 @@ public class Host { */ public static Host getByName(String name) throws HostNotFoundException { - Process.ifInterruptedStop(); if (name==null) throw new NullPointerException("No host can have a null name"); return MsgNative.hostGetByName(name); @@ -89,7 +88,6 @@ public class Host { * */ public static int getCount() { - Process.ifInterruptedStop(); return MsgNative.hostGetCount(); } @@ -99,7 +97,6 @@ public class Host { * @return The host on which the current process is executed. */ public static Host currentHost() { - Process.ifInterruptedStop(); return MsgNative.hostSelf(); } @@ -110,7 +107,6 @@ public class Host { * */ public static Host[] all() { - Process.ifInterruptedStop(); return MsgNative.allHosts(); } @@ -121,7 +117,6 @@ public class Host { * */ public String getName() { - Process.ifInterruptedStop(); return MsgNative.hostGetName(this); } @@ -132,7 +127,6 @@ public class Host { * @param data */ public void setData(Object data) { - Process.ifInterruptedStop(); this.data = data; } /** @@ -141,7 +135,6 @@ public class Host { * @return */ public Object getData() { - Process.ifInterruptedStop(); return this.data; } @@ -151,7 +144,6 @@ public class Host { * @return */ public boolean hasData() { - Process.ifInterruptedStop(); return null != this.data; } @@ -162,7 +154,6 @@ public class Host { * @return The number of tasks currently running on a host. */ public int getLoad() { - Process.ifInterruptedStop(); return MsgNative.hostGetLoad(this); } @@ -174,7 +165,6 @@ public class Host { * */ public double getSpeed() { - Process.ifInterruptedStop(); return MsgNative.hostGetSpeed(this); } @@ -182,7 +172,6 @@ public class Host { * @return */ public boolean isAvail() { - Process.ifInterruptedStop(); return MsgNative.hostIsAvail(this); } } diff --git a/org/simgrid/msg/Process.java b/org/simgrid/msg/Process.java index 43f86deba0..7289d96123 100644 --- a/org/simgrid/msg/Process.java +++ b/org/simgrid/msg/Process.java @@ -224,19 +224,6 @@ public abstract class Process extends Thread { { return nativeStop; } - /** - * checks if the flag that indicates that this thread must be killed is set to true; if true, starts to kill it. End users should not have to deal with it - * If you develop a new MSG native call, please include a call to interruptedStop() at the beginning of your method code, so as the process can be killed if he call - * your method. - * - * @return - * - */ - @Deprecated - public static void ifInterruptedStop() { - /* This function does nothing anymore and will get removed very soon */ - } - /** * This method kill a process. @@ -255,7 +242,6 @@ public abstract class Process extends Thread { * */ public void pause() { - Process.ifInterruptedStop(); MsgNative.processSuspend(this); } /** @@ -265,7 +251,6 @@ public abstract class Process extends Thread { * */ public void restart() { - Process.ifInterruptedStop(); MsgNative.processResume(this); } /** @@ -275,7 +260,6 @@ public abstract class Process extends Thread { * Otherwise the method returns false. */ public boolean isSuspended() { - Process.ifInterruptedStop(); return MsgNative.processIsSuspended(this); } /** @@ -286,7 +270,6 @@ public abstract class Process extends Thread { * */ public Host getHost() { - Process.ifInterruptedStop(); if (this.host == null) { this.host = MsgNative.processGetHost(this); } @@ -302,7 +285,6 @@ public abstract class Process extends Thread { * @exception NativeException on error in the native SimGrid code */ public static Process fromPID(int PID) throws NativeException { - Process.ifInterruptedStop(); return MsgNative.processFromPID(PID); } /** @@ -312,7 +294,6 @@ public abstract class Process extends Thread { * */ public int getPID() { - Process.ifInterruptedStop(); if (pid == -1) { pid = MsgNative.processGetPID(this); } @@ -325,7 +306,6 @@ public abstract class Process extends Thread { * */ public int getPPID() { - Process.ifInterruptedStop(); if (ppid == -1) { ppid = MsgNative.processGetPPID(this); } @@ -338,7 +318,6 @@ public abstract class Process extends Thread { * */ public static Process currentProcess() { - Process.ifInterruptedStop(); return MsgNative.processSelf(); } /** @@ -349,7 +328,6 @@ public abstract class Process extends Thread { * */ public static void migrate(Process process, Host host) { - Process.ifInterruptedStop(); MsgNative.processMigrate(process, host); process.host = null; } @@ -361,14 +339,12 @@ public abstract class Process extends Thread { * @exception HostFailureException on error in the native SimGrid code */ public static void waitFor(double seconds) throws HostFailureException { - Process.ifInterruptedStop(); MsgNative.processWaitFor(seconds); } /** * */ public void showArgs() { - Process.ifInterruptedStop(); Msg.info("[" + this.name + "/" + this.getHost().getName() + "] argc=" + this.args.size()); for (int i = 0; i < this.args.size(); i++) @@ -540,7 +516,6 @@ public abstract class Process extends Thread { * @throws HostFailureException * @throws TransferFailureException */ public void taskSend(String mailbox, Task task, double timeout) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); MsgNative.taskSend(mailbox, task, timeout); } @@ -551,7 +526,6 @@ public abstract class Process extends Thread { * @throws HostFailureException * @throws TransferFailureException */ public void taskSend(String mailbox, Task task) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); MsgNative.taskSend(mailbox, task, -1); } @@ -563,7 +537,6 @@ public abstract class Process extends Thread { * @throws TimeoutException */ public Task taskReceive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, -1.0, null); } @@ -576,7 +549,6 @@ public abstract class Process extends Thread { * @throws TimeoutException */ public Task taskReceive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, timeout, null); } @@ -590,7 +562,6 @@ public abstract class Process extends Thread { * @throws TimeoutException */ public Task taskReceive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, timeout, host); } @@ -603,7 +574,6 @@ public abstract class Process extends Thread { * @throws TimeoutException */ public Task taskReceive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, -1.0, host); } } diff --git a/org/simgrid/msg/Task.java b/org/simgrid/msg/Task.java index 907c26faa7..0e00afff57 100644 --- a/org/simgrid/msg/Task.java +++ b/org/simgrid/msg/Task.java @@ -68,45 +68,39 @@ public class Task { * @return */ public String getName() { - Process.ifInterruptedStop(); return MsgNative.taskGetName(this); } /** Gets the sender of the task */ Process getSender() { - Process.ifInterruptedStop(); return MsgNative.taskGetSender(this); } /** Gets the source of the task * @return */ public Host getSource() { - Process.ifInterruptedStop(); return MsgNative.taskGetSource(this); } /** Gets the computing amount of the task * @return */ public double getComputeDuration() { - Process.ifInterruptedStop(); return MsgNative.taskGetComputeDuration(this); } /** Gets the remaining computation of the task * @return */ public double getRemainingDuration() { - Process.ifInterruptedStop(); return MsgNative.taskGetRemainingDuration(this); } /** * This method sets the priority of the computation of the task. - * The priority doesn't affect the transfert rate. For example a + * The priority doesn't affect the transfer rate. For example a * priority of 2 will make the task receive two times more cpu than * the other ones. * * @param priority The new priority of the task. */ public void setPriority(double priority) { - Process.ifInterruptedStop(); MsgNative.taskSetPriority(this, priority); } /* * * * @@ -125,7 +119,6 @@ public class Task { * @throws TaskCancelledException */ public void execute() throws HostFailureException,TaskCancelledException { - Process.ifInterruptedStop(); MsgNative.taskExecute(this); } /** @@ -133,7 +126,6 @@ public class Task { * */ public void cancel() { - Process.ifInterruptedStop(); MsgNative.taskCancel(this); } /** Deletes a task. @@ -141,7 +133,6 @@ public class Task { * @exception NativeException if the destruction failed. */ protected void finalize() throws NativeException { - Process.ifInterruptedStop(); if (this.bind != 0) MsgNative.taskDestroy(this); } @@ -163,7 +154,6 @@ public class Task { * @throws TransferFailureException */ public void send(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); MsgNative.taskSend(mailbox, this, -1); } @@ -178,7 +168,6 @@ public class Task { * @throws TransferFailureException */ public void send(String mailbox, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); MsgNative.taskSend(mailbox, this, timeout); } @@ -192,7 +181,6 @@ public class Task { * @throws TimeoutException */ public void sendBounded(String alias, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); MsgNative.taskSendBounded(alias, this, maxrate); } @@ -207,7 +195,6 @@ public class Task { */ public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, -1.0, null); } @@ -222,7 +209,6 @@ public class Task { * @throws TimeoutException */ public static Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, timeout, null); } @@ -238,7 +224,6 @@ public class Task { */ public static Task receive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, -1.0, host); } @@ -254,7 +239,6 @@ public class Task { * @throws TimeoutException */ public static Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException { - Process.ifInterruptedStop(); return MsgNative.taskReceive(mailbox, timeout, host); } @@ -266,7 +250,6 @@ public class Task { * @return */ public static int listenFrom(String mailbox) { - Process.ifInterruptedStop(); return MsgNative.taskListenFrom(mailbox); } /** @@ -277,7 +260,6 @@ public class Task { * @return */ public static boolean listen(String mailbox) { - Process.ifInterruptedStop(); return MsgNative.taskListen(mailbox); } @@ -290,7 +272,6 @@ public class Task { * @return */ public static int listenFromHost(String alias, Host host) { - Process.ifInterruptedStop(); return MsgNative.taskListenFromHost(alias, host); } }