From: Martin Quinson Date: Fri, 9 Aug 2019 22:31:53 +0000 (+0200) Subject: small simplification X-Git-Tag: v3.24~203 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/65e32be46137f88aaa89385c2c9e83025bfbb06f?ds=sidebyside small simplification --- diff --git a/src/kernel/activity/MutexImpl.cpp b/src/kernel/activity/MutexImpl.cpp index 7d528fa056..9269c91f6e 100644 --- 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()) { - /* 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(); - act->waiting_synchro = nullptr; - owner_ = act; - act->simcall_answer(); + owner_->waiting_synchro = nullptr; + owner_->simcall_answer(); } else { /* nobody to wake up */ locked_ = false;