mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
scheduler: implement nice
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include <kernel/syscalls.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
syscallret_t syscall_nice(context_t *, int nice) {
|
||||
syscallret_t ret;
|
||||
|
||||
|
||||
if (nice < 0) {
|
||||
|
||||
}
|
||||
|
||||
current_thread()->proc->nice = max(min(current_thread()->proc->nice + nice, SCHED_NICE_MAX), SCHED_NICE_MIN);
|
||||
|
||||
ret.ret = current_thread()->proc->nice;
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user