1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

Kernel+LibC+WindowServer: Remove unused thread/process boost mechanism

The priority boosting mechanism has been broken for a very long time.
Let's remove it from the codebase and we can bring it back the day
someone feels like implementing it in a working way. :^)
This commit is contained in:
Andreas Kling 2021-01-16 14:48:32 +01:00
parent 43109f9614
commit 01c2480eb3
9 changed files with 1 additions and 96 deletions

View file

@ -104,36 +104,4 @@ int Process::sys$sched_getparam(pid_t pid, Userspace<struct sched_param*> user_p
return 0;
}
int Process::sys$set_thread_boost(pid_t tid, int amount)
{
REQUIRE_PROMISE(proc);
if (amount < 0 || amount > 20)
return -EINVAL;
ScopedSpinLock lock(g_scheduler_lock);
auto thread = Thread::from_tid(tid);
if (!thread)
return -ESRCH;
if (thread->state() == Thread::State::Dead || thread->state() == Thread::State::Dying)
return -ESRCH;
if (!is_superuser() && thread->process().uid() != euid())
return -EPERM;
thread->set_priority_boost(amount);
return 0;
}
int Process::sys$set_process_boost(pid_t pid, int amount)
{
REQUIRE_PROMISE(proc);
if (amount < 0 || amount > 20)
return -EINVAL;
ScopedSpinLock lock(g_processes_lock);
auto process = Process::from_pid(pid);
if (!process || process->is_dead())
return -ESRCH;
if (!is_superuser() && process->uid() != euid())
return -EPERM;
process->m_priority_boost = amount;
return 0;
}
}