diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-25 16:35:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-27 10:55:30 +0200 |
commit | 1fcac5adc5ed38fb88ce4c6d24b2ca2e27e3cd10 (patch) | |
tree | 7d2fed265befa680902ff146acb3305a360f9116 /cpukit/posix/src/pthreadgetschedparam.c | |
parent | score: Priority inherit thread queue operations (diff) | |
download | rtems-1fcac5adc5ed38fb88ce4c6d24b2ca2e27e3cd10.tar.bz2 |
score: Turn thread lock into thread wait lock
The _Thread_Lock_acquire() function had a potentially infinite run-time
due to the lack of fairness at atomic operations level.
Update #2412.
Update #2556.
Update #2765.
Diffstat (limited to 'cpukit/posix/src/pthreadgetschedparam.c')
-rw-r--r-- | cpukit/posix/src/pthreadgetschedparam.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c index a0a4c6e15b..1b7c731587 100644 --- a/cpukit/posix/src/pthreadgetschedparam.c +++ b/cpukit/posix/src/pthreadgetschedparam.c @@ -36,7 +36,7 @@ int pthread_getschedparam( ) { Thread_Control *the_thread; - ISR_lock_Context lock_context; + Thread_queue_Context queue_context; POSIX_API_Control *api; const Scheduler_Control *scheduler; Priority_Control priority; @@ -45,7 +45,7 @@ int pthread_getschedparam( return EINVAL; } - the_thread = _Thread_Get( thread, &lock_context ); + the_thread = _Thread_Get( thread, &queue_context.Lock_context ); if ( the_thread == NULL ) { return ESRCH; @@ -53,7 +53,7 @@ int pthread_getschedparam( api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - _Thread_Lock_acquire_default_critical( the_thread, &lock_context ); + _Thread_Wait_acquire_critical( the_thread, &queue_context ); *policy = api->Attributes.schedpolicy; *param = api->Attributes.schedparam; @@ -61,7 +61,7 @@ int pthread_getschedparam( scheduler = _Scheduler_Get_own( the_thread ); priority = the_thread->real_priority; - _Thread_Lock_release_default( the_thread, &lock_context ); + _Thread_Wait_release( the_thread, &queue_context ); param->sched_priority = _POSIX_Priority_From_core( scheduler, priority ); return 0; |