Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize simcall mutex_lock.
[simgrid.git] / src / s4u / s4u_Mutex.cpp
index 38b57a6..8975cb7 100644 (file)
@@ -21,7 +21,9 @@ Mutex::~Mutex()
 /** @brief Blocks the calling actor until the mutex can be obtained */
 void Mutex::lock()
 {
-  simcall_mutex_lock(pimpl_);
+  kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
+  mc::MutexLockSimcall observer{issuer, pimpl_};
+  kernel::actor::simcall_blocking<void>([&observer] { observer.get_mutex()->lock(observer.get_issuer()); }, &observer);
 }
 
 /** @brief Release the ownership of the mutex, unleashing a blocked actor (if any)