diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-22 19:10:04 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-22 19:10:04 +0000 |
commit | 4e1304dcb9d11c2b66c5f0239542d65acda40790 (patch) | |
tree | ddf1d95dae751bf68374e800835c37f8fd64f56e /cpukit/score/src/threadqfirst.c | |
parent | 2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-4e1304dcb9d11c2b66c5f0239542d65acda40790.tar.bz2 |
2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/src/threadqfirst.c: Remove switch.
Diffstat (limited to 'cpukit/score/src/threadqfirst.c')
-rw-r--r-- | cpukit/score/src/threadqfirst.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/cpukit/score/src/threadqfirst.c b/cpukit/score/src/threadqfirst.c index 9112b0ab72..8e268b87d9 100644 --- a/cpukit/score/src/threadqfirst.c +++ b/cpukit/score/src/threadqfirst.c @@ -43,19 +43,12 @@ Thread_Control *_Thread_queue_First( Thread_queue_Control *the_thread_queue ) { - Thread_Control *the_thread; + Thread_Control * (*first_p)(Thread_queue_Control *); - switch ( the_thread_queue->discipline ) { - case THREAD_QUEUE_DISCIPLINE_FIFO: - the_thread = _Thread_queue_First_fifo( the_thread_queue ); - break; - case THREAD_QUEUE_DISCIPLINE_PRIORITY: - the_thread = _Thread_queue_First_priority( the_thread_queue ); - break; - default: /* this is only to prevent warnings */ - the_thread = NULL; - break; - } + if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) + first_p = _Thread_queue_First_priority; + else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ + first_p = _Thread_queue_First_fifo; - return the_thread; + return (*first_p)( the_thread_queue ); } |