forked from Bananymous/banan-os
Kernel: remove Semaphore::is_blocked
this will not mean anything after semaphores can spuriously wake up
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,8 +11,6 @@ namespace Kernel
|
||||
|
||||
void Semaphore::unblock()
|
||||
{
|
||||
if (!m_blocked)
|
||||
return;
|
||||
Scheduler::get().unblock_threads(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user