From: Arnaud Giersch Date: Sat, 20 Mar 2021 20:28:40 +0000 (+0100) Subject: ActivityImpl::register_simcall does not need to be 'virtual'. X-Git-Tag: v3.27~70 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/42ec07cc0c4fb24df86b22c97bfbeab2f0a21c8e?hp=83ceec78c75b9ea471366e5bd5c1904f667c62b6 ActivityImpl::register_simcall does not need to be 'virtual'. --- diff --git a/src/kernel/activity/ActivityImpl.hpp b/src/kernel/activity/ActivityImpl.hpp index cc34a0882e..755eb2dae9 100644 --- a/src/kernel/activity/ActivityImpl.hpp +++ b/src/kernel/activity/ActivityImpl.hpp @@ -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; diff --git a/src/kernel/activity/MutexImpl.cpp b/src/kernel/activity/MutexImpl.cpp index c0f2a198da..2715bfb69a 100644 --- a/src/kernel/activity/MutexImpl.cpp +++ b/src/kernel/activity/MutexImpl.cpp @@ -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 */