@@ -224,20+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
- *
- */
- public static void ifInterruptedStop() {
- if ( (Thread.currentThread() instanceof Process) &&((Process) Thread.currentThread()).getNativeStop()) {
- throw new RuntimeException("Interrupted");
- }
- }
-
/**
* This method kill a process.
@@ -256,7+242,6 @@ public abstract class Process extends Thread {
*
*/
public void pause() {
- Process.ifInterruptedStop();
MsgNative.processSuspend(this);
}
/**
@@ -266,7+251,6 @@ public abstract class Process extends Thread {
*
*/
public void restart() {
- Process.ifInterruptedStop();
MsgNative.processResume(this);
}
/**
@@ -276,7+260,6 @@ public abstract class Process extends Thread {
* Otherwise the method returns false.
*/
public boolean isSuspended() {
- Process.ifInterruptedStop();
return MsgNative.processIsSuspended(this);
}
/**
@@ -287,7+270,6 @@ public abstract class Process extends Thread {
*
*/
public Host getHost() {
- Process.ifInterruptedStop();
if (this.host == null) {
this.host = MsgNative.processGetHost(this);
}
@@ -303,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);
}
/**
@@ -313,7+294,6 @@ public abstract class Process extends Thread {
*
*/
public int getPID() {
- Process.ifInterruptedStop();
if (pid == -1) {
pid = MsgNative.processGetPID(this);
}
@@ -326,7+306,6 @@ public abstract class Process extends Thread {
*
*/
public int getPPID() {
- Process.ifInterruptedStop();
if (ppid == -1) {
ppid = MsgNative.processGetPPID(this);
}
@@ -339,7+318,6 @@ public abstract class Process extends Thread {
*
*/
public static Process currentProcess() {
- Process.ifInterruptedStop();
return MsgNative.processSelf();
}
/**
@@ -350,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;
}
@@ -362,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 {