diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-24 06:13:11 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-24 08:46:20 +0100 |
commit | 620b23ece54a0bb43189bb9c0f14adf447cbafe6 (patch) | |
tree | 10aa72eb67ac01ab85f932ac25c09ba3e5d97da8 /cpukit/posix/src/condwaitsupp.c | |
parent | score: Fix interrupt profiling (diff) | |
download | rtems-620b23ece54a0bb43189bb9c0f14adf447cbafe6.tar.bz2 |
score: Optimize _Thread_queue_Enqueue()
Move thread state for _Thread_queue_Enqueue() to the thread queue
context. This reduces the parameter count of _Thread_queue_Enqueue()
from five to four (ARM for example has only four function parameter
registers). Since the thread state is used after several function calls
inside _Thread_queue_Enqueue() this parameter was saved on the stack
previously.
Diffstat (limited to 'cpukit/posix/src/condwaitsupp.c')
-rw-r--r-- | cpukit/posix/src/condwaitsupp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c index 9024dbf236..589b5e2810 100644 --- a/cpukit/posix/src/condwaitsupp.c +++ b/cpukit/posix/src/condwaitsupp.c @@ -117,6 +117,10 @@ int _POSIX_Condition_variables_Wait_support( executing = _Thread_Executing; if ( !already_timedout ) { + _Thread_queue_Context_set_thread_state( + &queue_context, + STATES_WAITING_FOR_CONDITION_VARIABLE + ); _Thread_queue_Context_set_enqueue_callout( &queue_context, _POSIX_Condition_variables_Enqueue_callout @@ -125,7 +129,6 @@ int _POSIX_Condition_variables_Wait_support( &the_cond->Wait_queue.Queue, POSIX_CONDITION_VARIABLES_TQ_OPERATIONS, executing, - STATES_WAITING_FOR_CONDITION_VARIABLE, &queue_context ); error = _POSIX_Get_error_after_wait( executing ); |