sched: Limit deadline scheduler parameter
The deadline of deadline scheduler should lager than zero because if deadline is negative, it menas the task should be finished in past. Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
This commit is contained in:
parent
ea3a47e38f
commit
555c07ef08
1 changed files with 3 additions and 0 deletions
|
@ -1058,6 +1058,9 @@ static inline void z_vrfy_k_thread_priority_set(k_tid_t thread, int prio)
|
|||
#ifdef CONFIG_SCHED_DEADLINE
|
||||
void z_impl_k_thread_deadline_set(k_tid_t tid, int deadline)
|
||||
{
|
||||
|
||||
deadline = CLAMP(deadline, 0, INT_MAX);
|
||||
|
||||
struct k_thread *thread = tid;
|
||||
int32_t newdl = k_cycle_get_32() + deadline;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue