summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadsetschedparam.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-18 08:36:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-04 13:36:10 +0100
commit03b900d3ed120ea919ea3eded7edbece3488cff3 (patch)
tree182781fc14fe15fd67caeb80e46f1c58495839c2 /cpukit/posix/src/pthreadsetschedparam.c
parentscore: Distribute clock tick to all online CPUs (diff)
downloadrtems-03b900d3ed120ea919ea3eded7edbece3488cff3.tar.bz2
score: Replace watchdog handler implementation
Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
Diffstat (limited to 'cpukit/posix/src/pthreadsetschedparam.c')
-rw-r--r--cpukit/posix/src/pthreadsetschedparam.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c
index c3be366818..c9560f59ac 100644
--- a/cpukit/posix/src/pthreadsetschedparam.c
+++ b/cpukit/posix/src/pthreadsetschedparam.c
@@ -44,6 +44,7 @@ int pthread_setschedparam(
Objects_Locations location;
int rc;
Priority_Control unused;
+ ISR_Level level;
/*
* Check all the parameters
@@ -69,8 +70,11 @@ int pthread_setschedparam(
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- if ( api->schedpolicy == SCHED_SPORADIC )
- _Watchdog_Remove_ticks( &api->Sporadic_timer );
+ if ( api->schedpolicy == SCHED_SPORADIC ) {
+ _ISR_Disable( level );
+ _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer );
+ _ISR_Enable( level );
+ }
api->schedpolicy = policy;
api->schedparam = *param;
@@ -97,8 +101,10 @@ int pthread_setschedparam(
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
- _Watchdog_Remove_ticks( &api->Sporadic_timer );
- _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
+ _ISR_Disable( level );
+ _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer );
+ _ISR_Enable( level );
+ _POSIX_Threads_Sporadic_budget_TSR( &api->Sporadic_timer );
break;
}