diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-01 21:49:40 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-01 21:49:40 +0000 |
commit | 770db692bc379595785a11a8cd4543daa360286c (patch) | |
tree | 112ea5515c6cb5a9f1d712f674e9e288a58ade11 /cpukit/posix/src/pthread.c | |
parent | 2009-08-01 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-770db692bc379595785a11a8cd4543daa360286c.tar.bz2 |
2009-08-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/src/psxtransschedparam.c, posix/src/pthread.c: Add error checks
for 0 time on sporadic scheduler replenish period and initial budget.
This avoids having to correct for it in the TSR, so we can eliminate
the check for ticks == 0 there.
Diffstat (limited to 'cpukit/posix/src/pthread.c')
-rw-r--r-- | cpukit/posix/src/pthread.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index c9f93f7e25..ee5a8db9aa 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -78,11 +78,9 @@ void _POSIX_Threads_Sporadic_budget_TSR( api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_initial_budget ); - if ( !ticks ) - ticks = 1; - the_thread->cpu_time_budget = ticks; new_priority = _POSIX_Priority_To_core( api->ss_high_priority ); @@ -92,11 +90,9 @@ void _POSIX_Threads_Sporadic_budget_TSR( the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, true ); + /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_replenish_period ); - if ( !ticks ) - ticks = 1; - _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } |