Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
small simplifications around simcalls
[simgrid.git] / src / kernel / activity / SemaphoreImpl.cpp
index 4848f27..2daeba6 100644 (file)
@@ -14,14 +14,11 @@ namespace activity {
 
 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());
-    (*synchro).set_host(issuer->get_host()).set_timeout(timeout).start();
-    synchro->simcalls_.push_front(&issuer->simcall);
-    issuer->waiting_synchro = synchro;
+    RawImplPtr synchro = RawImplPtr(new RawImpl());
+    synchro->set_host(issuer->get_host()).set_timeout(timeout).start();
+    synchro->register_simcall(&issuer->simcall);
     sleeping_.push_back(*issuer);
   } else {
     value_--;