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
cosmetics (codefactor+coding style)
[simgrid.git]
/
src
/
kernel
/
activity
/
MutexImpl.cpp
diff --git
a/src/kernel/activity/MutexImpl.cpp
b/src/kernel/activity/MutexImpl.cpp
index
7d528fa
..
9274c47
100644
(file)
--- a/
src/kernel/activity/MutexImpl.cpp
+++ b/
src/kernel/activity/MutexImpl.cpp
@@
-68,12
+68,11
@@
void MutexImpl::unlock(actor::ActorImpl* issuer)
owner_->get_cname(), owner_->get_pid());
if (not sleeping_.empty()) {
owner_->get_cname(), owner_->get_pid());
if (not sleeping_.empty()) {
- /*
pick one actor to wake up
*/
-
actor::ActorImpl* act
= &sleeping_.front();
+ /*
Give the ownership to the first waiting actor
*/
+
owner_
= &sleeping_.front();
sleeping_.pop_front();
sleeping_.pop_front();
- act->waiting_synchro = nullptr;
- owner_ = act;
- act->simcall_answer();
+ owner_->waiting_synchro = nullptr;
+ owner_->simcall_answer();
} else {
/* nobody to wake up */
locked_ = false;
} else {
/* nobody to wake up */
locked_ = false;
@@
-102,15
+101,15
@@
void MutexImpl::unref()
void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex)
{
void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex)
{
- mutex->lock(simcall->issuer);
+ mutex->lock(simcall->issuer
_
);
}
int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex)
{
}
int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex)
{
- return mutex->try_lock(simcall->issuer);
+ return mutex->try_lock(simcall->issuer
_
);
}
void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex)
{
}
void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex)
{
- mutex->unlock(simcall->issuer);
+ mutex->unlock(simcall->issuer
_
);
}
}