Kernel: remove Semaphore::is_blocked

this will not mean anything after semaphores can spuriously wake up
This commit is contained in:
Bananymous 2023-07-24 22:23:13 +03:00
parent f5f4bf58ad
commit cc8af25d73
3 changed files with 1 additions and 15 deletions

View File

@ -8,15 +8,6 @@ namespace Kernel
public:
void block();
void unblock();
bool is_blocked() const { return m_blocked; }
private:
void set_blocked(bool blocked) { m_blocked = blocked; }
private:
bool m_blocked { false };
friend class Scheduler;
};
}

View File

@ -327,15 +327,13 @@ namespace Kernel
static_assert(sizeof(ActiveThread) == sizeof(BlockingThread));
MUST(m_blocking_threads.emplace_back(blocking, semaphore));
semaphore->m_blocked = true;
execute_current_thread();
ASSERT_NOT_REACHED();
}
void Scheduler::unblock_threads(Semaphore* semaphore)
{
Kernel::CriticalScope critical;
CriticalScope critical;
for (auto it = m_blocking_threads.begin(); it != m_blocking_threads.end();)
{
@ -354,7 +352,6 @@ namespace Kernel
}
}
semaphore->m_blocked = false;
}
}

View File

@ -11,8 +11,6 @@ namespace Kernel
void Semaphore::unblock()
{
if (!m_blocked)
return;
Scheduler::get().unblock_threads(this);
}