A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modernize simcall mutex_trylock.
[simgrid.git]
/
src
/
s4u
/
s4u_Mutex.cpp
diff --git
a/src/s4u/s4u_Mutex.cpp
b/src/s4u/s4u_Mutex.cpp
index
d6a65f6
..
38b57a6
100644
(file)
--- a/
src/s4u/s4u_Mutex.cpp
+++ b/
src/s4u/s4u_Mutex.cpp
@@
-38,7
+38,10
@@
void Mutex::unlock()
/** @brief Acquire the mutex if it's free, and return false (without blocking) if not */
bool Mutex::try_lock()
{
/** @brief Acquire the mutex if it's free, and return false (without blocking) if not */
bool Mutex::try_lock()
{
- return simcall_mutex_trylock(pimpl_);
+ kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
+ mc::MutexTrylockSimcall observer{issuer, pimpl_};
+ return kernel::actor::simcall([&observer] { return observer.get_mutex()->try_lock(observer.get_issuer()); },
+ &observer);
}
/** @brief Create a new mutex
}
/** @brief Create a new mutex