-/* 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. */
simgrid::simix::kernelImmediate([this]() { pimpl_->daemonize(); });
}
+bool Actor::isDaemon()
+{
+ return this->pimpl_->isDaemon();
+}
+
const simgrid::xbt::string& Actor::getName() const
{
return this->pimpl_->getName();
void Actor::kill(aid_t pid)
{
+ smx_actor_t killer = SIMIX_process_self();
smx_actor_t process = SIMIX_process_from_PID(pid);
if(process != nullptr) {
- simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); });
+ simgrid::simix::kernelImmediate([killer, process] { SIMIX_process_kill(process, killer); });
} else {
std::ostringstream oss;
- oss << "kill: ("<< pid <<") - No such process" << std::endl;
+ oss << "kill: (" << pid << ") - No such actor" << std::endl;
throw std::runtime_error(oss.str());
}
}
-smx_actor_t Actor::getImpl() {
- return pimpl_;
-}
-
void Actor::kill() {
smx_actor_t process = SIMIX_process_self();
simgrid::simix::kernelImmediate(
[this, process] { SIMIX_process_kill(pimpl_, (pimpl_ == simix_global->maestro_process) ? pimpl_ : process); });
}
+smx_actor_t Actor::getImpl()
+{
+ return pimpl_;
+}
+
// ***** Static functions *****
ActorPtr Actor::byPid(aid_t pid)
void Actor::killAll()
{
- simcall_process_killall(1);
-}
-
-void Actor::killAll(int resetPid)
-{
- simcall_process_killall(resetPid);
+ simcall_process_killall();
}
std::map<std::string, std::string>* Actor::getProperties()
simgrid::simix::kernelImmediate([] { /* do nothing*/ });
}
-XBT_PUBLIC(void) sleep_until(double timeout)
+XBT_PUBLIC void sleep_until(double timeout)
{
double now = SIMIX_get_clock();
if (timeout > now)