Fix timeslice calculation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@232 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
c02b8b1e8b
commit
28c3d07135
|
@ -101,7 +101,7 @@ void up_unblock_task(_TCB *tcb)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
tcb->timeslice = CONFIG_RR_INTERVAL;
|
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add the task in the correct location in the prioritized
|
/* Add the task in the correct location in the prioritized
|
||||||
|
|
|
@ -101,7 +101,7 @@ void up_unblock_task(_TCB *tcb)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
tcb->timeslice = CONFIG_RR_INTERVAL;
|
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add the task in the correct location in the prioritized
|
/* Add the task in the correct location in the prioritized
|
||||||
|
|
|
@ -100,7 +100,7 @@ void up_unblock_task(_TCB *tcb)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
tcb->timeslice = CONFIG_RR_INTERVAL;
|
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add the task in the correct location in the prioritized
|
/* Add the task in the correct location in the prioritized
|
||||||
|
|
|
@ -101,7 +101,7 @@ void up_unblock_task(FAR _TCB *tcb)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
tcb->timeslice = CONFIG_RR_INTERVAL;
|
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add the task in the correct location in the prioritized
|
/* Add the task in the correct location in the prioritized
|
||||||
|
|
|
@ -100,7 +100,7 @@ void up_unblock_task(_TCB *tcb)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
tcb->timeslice = CONFIG_RR_INTERVAL;
|
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add the task in the correct location in the prioritized
|
/* Add the task in the correct location in the prioritized
|
||||||
|
|
|
@ -365,7 +365,7 @@ int pthread_create(pthread_t *thread, pthread_attr_t *attr,
|
||||||
if (policy == SCHED_RR)
|
if (policy == SCHED_RR)
|
||||||
{
|
{
|
||||||
ptcb->flags |= TCB_FLAG_ROUND_ROBIN;
|
ptcb->flags |= TCB_FLAG_ROUND_ROBIN;
|
||||||
ptcb->timeslice = CONFIG_RR_INTERVAL;
|
ptcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ static void sched_process_timeslice(void)
|
||||||
{
|
{
|
||||||
/* Reset the timeslice in any case. */
|
/* Reset the timeslice in any case. */
|
||||||
|
|
||||||
rtcb->timeslice = CONFIG_RR_INTERVAL;
|
rtcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||||
|
|
||||||
/* We know we are at the head of the ready to run
|
/* We know we are at the head of the ready to run
|
||||||
* prioritized list. We must be the highest priority
|
* prioritized list. We must be the highest priority
|
||||||
|
|
Loading…
Reference in New Issue