mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
sched/task: setup the scheduling policy to task
Change-Id: I1cd2869a98e3418e089ac5ebe5fce648f8cb4e09 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user