summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthread.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/pthread.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/pthread.c')
-rw-r--r--cpukit/posix/src/pthread.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index eb7d652d77..e096dd6bea 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -91,8 +91,9 @@ void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic.Timer );
the_thread = api->thread;
- _Thread_Wait_acquire( the_thread, &queue_context );
+ _Thread_queue_Context_initialize( &queue_context );
_Thread_queue_Context_clear_priority_updates( &queue_context );
+ _Thread_Wait_acquire( the_thread, &queue_context );
if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
_Thread_Priority_add(
@@ -122,8 +123,9 @@ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- _Thread_Wait_acquire( the_thread, &queue_context );
+ _Thread_queue_Context_initialize( &queue_context );
_Thread_queue_Context_clear_priority_updates( &queue_context );
+ _Thread_Wait_acquire( the_thread, &queue_context );
/*
* This will prevent the thread from consuming its entire "budget"