sched/task: setup the scheduling policy to task

Change-Id: I1cd2869a98e3418e089ac5ebe5fce648f8cb4e09
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2021-01-19 15:15:13 +08:00
committed by chao an
parent 8775bd3c3b
commit b3f1c7b2d2
+10
View File
@@ -368,6 +368,16 @@ static int nxthread_setup_scheduler(FAR struct tcb_s *tcb, int priority,
tcb->flags &= ~TCB_FLAG_TTYPE_MASK;
tcb->flags |= ttype;
/* Set the appropriate scheduling policy in the TCB */
tcb->flags &= ~TCB_FLAG_POLICY_MASK;
#if CONFIG_RR_INTERVAL > 0
tcb->flags |= TCB_FLAG_SCHED_RR;
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#else
tcb->flags |= TCB_FLAG_SCHED_FIFO;
#endif
#ifdef CONFIG_CANCELLATION_POINTS
/* Set the deferred cancellation type */