X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/970c8495eefefffaef85acdf1d6923799d95962a..65e32be46137f88aaa89385c2c9e83025bfbb06f:/src/kernel/activity/MutexImpl.cpp 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;