#ifndef SIMGRID_S4U_ACTOR_HPP
#define SIMGRID_S4U_ACTOR_HPP
+#include <stdexcept>
#include <xbt/base.h>
#include <simgrid/simix.h>
#include <simgrid/s4u/forward.hpp>
*/
void kill();
+ static void kill(int PID);
+
// Static methods on all actors:
/** Ask kindly to all actors to die. Only the issuer will survive. */
return simcall_process_get_kill_time(pimpl_);
}
+void s4u::Actor::kill(int PID) {
+ msg_process_t process = SIMIX_process_from_PID(PID);
+ if(process != NULL) {
+ simcall_process_kill(process);
+ } else {
+ std::ostringstream oss;
+ oss << "kill: ("<< PID <<") - No such process" << std::endl;
+ throw std::runtime_error(oss.str());
+ }
+}
+
void s4u::Actor::kill() {
simcall_process_kill(pimpl_);
}