Kernel: Semaphores and Threads can now be blocked with timeout

This commit is contained in:
2024-02-09 15:18:34 +02:00
parent 534b3e6a9a
commit ed0b1a86aa
17 changed files with 86 additions and 78 deletions

View File

@@ -67,13 +67,12 @@ namespace Kernel
while (SystemTimer::get().ms_since_boot() < start_time + s_nvme_command_timeout_ms)
{
if (!m_done)
if (m_done)
{
m_semaphore.block();
continue;
m_done = false;
return m_status;
}
m_done = false;
return m_status;
m_semaphore.block_with_wake_time(start_time + s_nvme_command_timeout_ms);
}
return 0xFFFF;