1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 04:45:09 +00:00

Kernel: Consolidate the various BlockCondition::unblock variants

The unblock_all variant used to ASSERT if a blocker didn't unblock,
but it wasn't clear from the name that it would do that. Because
the BlockCondition already asserts that no blockers are left at
destruction time, it would still catch blockers that haven't been
unblocked for whatever reason.

Fixes #4496
This commit is contained in:
Tom 2020-12-22 11:17:56 -07:00 committed by Andreas Kling
parent 94e4aa94b5
commit 49a76164c8
6 changed files with 16 additions and 57 deletions

View file

@ -469,7 +469,7 @@ bool Plan9FS::Plan9FSBlockCondition::should_add_blocker(Thread::Blocker& b, void
void Plan9FS::Plan9FSBlockCondition::unblock_completed(u16 tag)
{
unblock([&](Thread::Blocker& b, void*) {
unblock([&](Thread::Blocker& b, void*, bool&) {
ASSERT(b.blocker_type() == Thread::Blocker::Type::Plan9FS);
auto& blocker = static_cast<Blocker&>(b);
return blocker.unblock(tag);
@ -478,7 +478,7 @@ void Plan9FS::Plan9FSBlockCondition::unblock_completed(u16 tag)
void Plan9FS::Plan9FSBlockCondition::unblock_all()
{
BlockCondition::unblock_all([&](Thread::Blocker& b, void*) {
unblock([&](Thread::Blocker& b, void*, bool&) {
ASSERT(b.blocker_type() == Thread::Blocker::Type::Plan9FS);
auto& blocker = static_cast<Blocker&>(b);
return blocker.unblock();