mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
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
This commit is contained in:
parent
82c4812730
commit
72440d90fe
1 changed files with 3 additions and 1 deletions
|
@ -409,16 +409,18 @@ public:
|
||||||
{
|
{
|
||||||
ASSERT(m_lock.is_locked());
|
ASSERT(m_lock.is_locked());
|
||||||
bool stop_iterating = false;
|
bool stop_iterating = false;
|
||||||
|
bool did_unblock = false;
|
||||||
for (size_t i = 0; i < m_blockers.size() && !stop_iterating;) {
|
for (size_t i = 0; i < m_blockers.size() && !stop_iterating;) {
|
||||||
auto& info = m_blockers[i];
|
auto& info = m_blockers[i];
|
||||||
if (unblock_one(*info.blocker, info.data, stop_iterating)) {
|
if (unblock_one(*info.blocker, info.data, stop_iterating)) {
|
||||||
m_blockers.remove(i);
|
m_blockers.remove(i);
|
||||||
|
did_unblock = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
return !stop_iterating;
|
return did_unblock;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool should_add_blocker(Blocker&, void*) { return true; }
|
virtual bool should_add_blocker(Blocker&, void*) { return true; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue