mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
Allow the scheduler to unblock the current process.
It's a bit confusing that the "current" process is not actually running while we're inside the scheduler. Perhaps the scheduler should redirect "current" to its own dummy Process. I'm not sure. Regardless, this patch improves responsiveness by allowing the scheduler to unblock a process right after it calls select() in case it already has a pending wakeup request.
This commit is contained in:
@@ -1551,7 +1551,8 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
||||
void Process::unblock()
|
||||
{
|
||||
if (current == this) {
|
||||
kprintf("ignoring unblock() on current, %s(%u) {%s}\n", name().characters(), pid(), toString(state()));
|
||||
system.nblocked--;
|
||||
m_state = Process::Running;
|
||||
return;
|
||||
}
|
||||
ASSERT(m_state != Process::Runnable && m_state != Process::Running);
|
||||
|
||||
Reference in New Issue
Block a user