diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-11 13:42:58 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-12 13:24:41 +0200 |
commit | 8bc6bf28aa098a03c25763e3c59274874bfbe3da (patch) | |
tree | c7b1434c02d96b48cba14c3bcfeb2c865c4f816f /cpukit/posix/src/pthread.c | |
parent | score: Avoid Giant lock _Scheduler_Get_affinity() (diff) | |
download | rtems-8bc6bf28aa098a03c25763e3c59274874bfbe3da.tar.bz2 |
posix: Avoid Giant lock for some pthread functions
Avoid Giant lock for pthread_getattr_np(), pthread_setschedparam() and
pthread_getschedparam(). Replace POSIX threads scheduler lock with
thread state lock.
Update #2555.
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/pthread.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index 61e498bce1..5c5cff71d2 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -114,7 +114,7 @@ void _POSIX_Threads_Sporadic_budget_TSR( Watchdog_Control *watchdog ) api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic_timer ); the_thread = api->thread; - _POSIX_Threads_Scheduler_acquire( api, &lock_context ); + _Thread_State_acquire( the_thread, &lock_context ); the_thread->cpu_time_budget = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); @@ -128,7 +128,7 @@ void _POSIX_Threads_Sporadic_budget_TSR( Watchdog_Control *watchdog ) new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); - _POSIX_Threads_Scheduler_release( api, &lock_context ); + _Thread_State_release( the_thread, &lock_context ); _Thread_Change_priority( the_thread, @@ -200,8 +200,6 @@ static bool _POSIX_Threads_Create_extension( api = created->API_Extensions[ THREAD_API_POSIX ]; - _ISR_lock_Initialize( &api->Scheduler_lock, "POSIX Threads Scheduler" ); - /* XXX check all fields are touched */ api->thread = created; _POSIX_Threads_Initialize_attributes( &api->Attributes ); @@ -253,7 +251,6 @@ static void _POSIX_Threads_Delete_extension( api = deleted->API_Extensions[ THREAD_API_POSIX ]; - _ISR_lock_Destroy( &api->Scheduler_lock ); _Thread_queue_Destroy( &api->Join_List ); } @@ -281,13 +278,13 @@ static void _POSIX_Threads_Terminate_extension( _Thread_Enable_dispatch(); - _POSIX_Threads_Scheduler_acquire( api, &lock_context ); + _Thread_State_acquire( executing, &lock_context ); if ( api->schedpolicy == SCHED_SPORADIC ) { _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer ); } - _POSIX_Threads_Scheduler_release( api, &lock_context ); + _Thread_State_release( executing, &lock_context ); } /* |