X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/efe776a7f971fa0f6641baa5c835364604b600c8..65e32be46137f88aaa89385c2c9e83025bfbb06f:/src/kernel/activity/SemaphoreImpl.cpp diff --git a/src/kernel/activity/SemaphoreImpl.cpp b/src/kernel/activity/SemaphoreImpl.cpp index cedb307903..05dc8d79a3 100644 --- a/src/kernel/activity/SemaphoreImpl.cpp +++ b/src/kernel/activity/SemaphoreImpl.cpp @@ -5,7 +5,6 @@ #include "src/kernel/activity/SemaphoreImpl.hpp" #include "src/kernel/activity/SynchroRaw.hpp" -#include "src/simix/smx_synchro_private.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_semaphore, simix_synchro, "Semaphore kernel-space implementation"); @@ -13,19 +12,20 @@ namespace simgrid { namespace kernel { namespace activity { -void SemaphoreImpl::acquire(smx_actor_t issuer, double timeout) +void SemaphoreImpl::acquire(actor::ActorImpl* issuer, double timeout) { RawImplPtr synchro = nullptr; XBT_DEBUG("Wait semaphore %p (timeout:%f)", this, timeout); if (value_ <= 0) { - synchro = RawImplPtr(new RawImpl())->start(issuer->get_host(), timeout); + synchro = RawImplPtr(new RawImpl()); + (*synchro).set_host(issuer->get_host()).set_timeout(timeout).start(); synchro->simcalls_.push_front(&issuer->simcall); issuer->waiting_synchro = synchro; sleeping_.push_back(*issuer); } else { value_--; - SIMIX_simcall_answer(&issuer->simcall); + issuer->simcall_answer(); } } void SemaphoreImpl::release() @@ -36,7 +36,7 @@ void SemaphoreImpl::release() auto& actor = sleeping_.front(); sleeping_.pop_front(); actor.waiting_synchro = nullptr; - SIMIX_simcall_answer(&actor.simcall); + actor.simcall_answer(); } else { value_++; }