From 72440d90fead7ad0c353edf9e2df8201b8459c4e Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 30 Dec 2020 19:29:41 -0700 Subject: [PATCH] Kernel: Fix BlockCondition::unblock return value BlockCondition::unblock should return true if it unblocked at least one thread, not if iterating the blockers had been stopped. This is a regression introduced by 49a76164c. Fixes #4670 --- Kernel/Thread.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 3ff8fcd96e..7dab17aa6e 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -409,16 +409,18 @@ public: { ASSERT(m_lock.is_locked()); bool stop_iterating = false; + bool did_unblock = false; for (size_t i = 0; i < m_blockers.size() && !stop_iterating;) { auto& info = m_blockers[i]; if (unblock_one(*info.blocker, info.data, stop_iterating)) { m_blockers.remove(i); + did_unblock = true; continue; } i++; } - return !stop_iterating; + return did_unblock; } virtual bool should_add_blocker(Blocker&, void*) { return true; }