void kill();
static void kill(int pid);
+ static Actor forPid(int pid);
/**
* Wait for the actor to finish.
/** Ask kindly to all actors to die. Only the issuer will survive. */
static void killAll();
+ bool valid() const { return pimpl_ != nullptr; }
+
private:
smx_process_t pimpl_ = nullptr;
};
simcall_process_kill(pimpl_);
}
+simgrid::s4u::Actor s4u::Actor::forPid(int pid)
+{
+ // Should we throw if we did not find it?
+ smx_process_t process = SIMIX_process_from_PID(pid);
+ return simgrid::s4u::Actor(process);
+}
+
// static stuff:
void s4u::Actor::killAll() {