summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadsetschedprio.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-12-01 20:42:48 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-12-02 12:41:03 +0100
commit5b6c290ed0fae8f9afd343c891e6d3650ef22492 (patch)
treef01c2825980599091959ff403c98fb95ee5851d3 /cpukit/posix/src/pthreadsetschedprio.c
parentposix: Fix typo (diff)
downloadrtems-5b6c290ed0fae8f9afd343c891e6d3650ef22492.tar.bz2
score: Initialize thread queue context early
Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
Diffstat (limited to 'cpukit/posix/src/pthreadsetschedprio.c')
-rw-r--r--cpukit/posix/src/pthreadsetschedprio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/posix/src/pthreadsetschedprio.c b/cpukit/posix/src/pthreadsetschedprio.c
index 16b6f3f585..ff7bd5c271 100644
--- a/cpukit/posix/src/pthreadsetschedprio.c
+++ b/cpukit/posix/src/pthreadsetschedprio.c
@@ -27,13 +27,14 @@ int pthread_setschedprio( pthread_t thread, int prio )
Priority_Control new_priority;
bool valid;
+ _Thread_queue_Context_initialize( &queue_context );
+ _Thread_queue_Context_clear_priority_updates( &queue_context );
the_thread = _Thread_Get( thread, &queue_context.Lock_context.Lock_context );
if ( the_thread == NULL ) {
return ESRCH;
}
- _Thread_queue_Context_clear_priority_updates( &queue_context );
_Thread_Wait_acquire_critical( the_thread, &queue_context );
scheduler = _Thread_Scheduler_get_home( the_thread );