Kernel: Free keyboard mutex while waiting for data to read

This was making select hang if one thread was trying to read from
keyboard.
This commit is contained in:
Bananymous 2024-06-17 23:04:37 +03:00
parent 301dcd78cc
commit f1e366d36f
1 changed files with 4 additions and 1 deletions

View File

@ -204,7 +204,10 @@ namespace Kernel::Input
while (m_event_queue.empty())
{
m_event_lock.unlock(state);
TRY(Thread::current().block_or_eintr_indefinite(m_semaphore));
{
LockFreeGuard _(m_mutex);
TRY(Thread::current().block_or_eintr_indefinite(m_semaphore));
}
state = m_event_lock.lock();
}