From 65e32be46137f88aaa89385c2c9e83025bfbb06f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 10 Aug 2019 00:31:53 +0200 Subject: [PATCH] small simplification --- src/kernel/activity/MutexImpl.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; -- 2.20.1