-/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2018. 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. */
*
* @param host Where to create the process.
* @param name The name of the process.
- * @param args The arguments of main method of the process.
+ * @param argsParam The arguments of main method of the process.
*/
- public Process(Host host, String name, String[]args)
+ public Process(Host host, String name, String[]argsParam)
{
if (host == null)
throw new IllegalArgumentException("Cannot create a process on the null host");
this.name = name;
this.args = new ArrayList<>();
- if (null != args)
- this.args.addAll(Arrays.asList(args));
+ if (null != argsParam)
+ this.args.addAll(Arrays.asList(argsParam));
}
/**
* Constructs a new process from a host and his name, the arguments of here method function are
/**
* This method kills all running process of the simulation.
*
- * @param resetPID Should we reset the PID numbers. A negative number means no reset
- * and a positive number will be used to set the PID of the next newly
- * created process.
- *
* @return The function returns the PID of the next created process.
*
*/
- public static native int killAll(int resetPID);
+ public static native int killAll();
/** Simply kills the receiving process.
*
@Override
public void run() {
- String[] args = null; /* do not fill it before the signal or this.args will be empty */
-
try {
- args = new String[this.args.size()];
- if (!this.args.isEmpty()) {
- this.args.toArray(args);
- }
+ String[] argsArray = new String[this.args.size()];
+ this.args.toArray(argsArray);
- this.main(args);
+ this.main(argsArray);
}
catch(MsgException e) {
e.printStackTrace();