diff --git a/kernel/include/kernel/Semaphore.h b/kernel/include/kernel/Semaphore.h index 6ad21e666f..0a1a151b2e 100644 --- a/kernel/include/kernel/Semaphore.h +++ b/kernel/include/kernel/Semaphore.h @@ -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; }; } \ No newline at end of file diff --git a/kernel/kernel/Scheduler.cpp b/kernel/kernel/Scheduler.cpp index 9b3d1d45c2..5242a255da 100644 --- a/kernel/kernel/Scheduler.cpp +++ b/kernel/kernel/Scheduler.cpp @@ -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; } } \ No newline at end of file diff --git a/kernel/kernel/Semaphore.cpp b/kernel/kernel/Semaphore.cpp index 685436bbd7..7d7b232107 100644 --- a/kernel/kernel/Semaphore.cpp +++ b/kernel/kernel/Semaphore.cpp @@ -11,8 +11,6 @@ namespace Kernel void Semaphore::unblock() { - if (!m_blocked) - return; Scheduler::get().unblock_threads(this); }