X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c4f055b70f68bb462cefb9e4ecea8a3d5320dd0d..2807fde4fd1f59c230d69a934634c5dfb77905f2:/src/s4u/s4u_actor.cpp diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index db27edc18c..86ea2e2fb4 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -11,7 +11,7 @@ #include "simgrid/s4u/Mailbox.hpp" #include "src/kernel/context/Context.hpp" -#include "src/simix/smx_private.h" +#include "src/simix/smx_private.hpp" #include @@ -85,14 +85,14 @@ void Actor::daemonize() simgrid::simix::kernelImmediate([this]() { pimpl_->daemonize(); }); } -const char* Actor::getCname() +const simgrid::xbt::string& Actor::getName() const { - return this->pimpl_->name.c_str(); + return this->pimpl_->getName(); } -simgrid::xbt::string Actor::getName() +const char* Actor::getCname() const { - return this->pimpl_->name; + return this->pimpl_->getCname(); } aid_t Actor::getPid() @@ -120,11 +120,6 @@ int Actor::isSuspended() return simgrid::simix::kernelImmediate([this] { return pimpl_->suspended; }); } -void Actor::yield() -{ - simgrid::simix::kernelImmediate([] { /* do nothing*/ }); -} - void Actor::setKillTime(double time) { simcall_process_set_kill_time(pimpl_,time); } @@ -219,6 +214,11 @@ void sleep_for(double duration) simcall_process_sleep(duration); } +void yield() +{ + simgrid::simix::kernelImmediate([] { /* do nothing*/ }); +} + XBT_PUBLIC(void) sleep_until(double timeout) { double now = SIMIX_get_clock(); @@ -232,6 +232,12 @@ void execute(double flops) simcall_execution_wait(s); } +void execute(double flops,double priority) +{ + smx_activity_t s = simcall_execution_start(nullptr,flops,1 / priority/*priority*/,0./*bound*/); + simcall_execution_wait(s); +} + void* recv(MailboxPtr chan) // deprecated { return chan->get(); @@ -274,7 +280,12 @@ aid_t getPpid() std::string getName() { - return SIMIX_process_self()->name; + return SIMIX_process_self()->getName(); +} + +const char* getCname() +{ + return SIMIX_process_self()->getCname(); } Host* getHost()