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:
parent
f5f4bf58ad
commit
cc8af25d73
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue