Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ActivityImpl::register_simcall does not need to be 'virtual'.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 20 Mar 2021 20:28:40 +0000 (21:28 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 22 Mar 2021 10:48:32 +0000 (11:48 +0100)
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/MutexImpl.cpp

index cc34a08..755eb2d 100644 (file)
@@ -59,7 +59,7 @@ public:
   virtual void finish() = 0; // Unlock all simcalls blocked on that activity, either because it was marked as done by
                              // the model or because it terminated without waiting for the model
 
-  virtual void register_simcall(smx_simcall_t simcall);
+  void register_simcall(smx_simcall_t simcall);
   void unregister_simcall(smx_simcall_t simcall);
   void clean_action();
   virtual double get_remaining() const;
index c0f2a19..2715bfb 100644 (file)
@@ -34,8 +34,7 @@ void MutexImpl::lock(actor::ActorImpl* issuer)
     /* Somebody using the mutex, use a synchronization to get host failures */
     synchro = RawImplPtr(new RawImpl([this, issuer]() { this->remove_sleeping_actor(*issuer); }));
     (*synchro).set_host(issuer->get_host()).start();
-    synchro->simcalls_.push_back(&issuer->simcall_);
-    issuer->waiting_synchro_ = synchro;
+    synchro->register_simcall(&issuer->simcall_);
     sleeping_.push_back(*issuer);
   } else {
     /* mutex free */