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:
patacongo 2007-05-20 15:43:53 +00:00
parent c02b8b1e8b
commit 28c3d07135
7 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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