diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-22 18:28:53 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-22 18:28:53 +0000 |
commit | 3168deaa10fae157b38a94c5204a66d28a43ad7a (patch) | |
tree | 0bda84e785960fa6641c2b167d626cf3271b3352 /cpukit/score/src/threadqdequeue.c | |
parent | 2008-01-22 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-3168deaa10fae157b38a94c5204a66d28a43ad7a.tar.bz2 |
2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/include/rtems/rtems/event.h,
rtems/inline/rtems/rtems/eventset.inl, rtems/src/event.c,
rtems/src/eventseize.c, rtems/src/eventsurrender.c,
rtems/src/eventtimeout.c, score/Makefile.am, score/preinstall.am,
score/include/rtems/score/interr.h,
score/include/rtems/score/thread.h,
score/include/rtems/score/threadq.h,
score/include/rtems/score/tqdata.h,
score/inline/rtems/score/threadq.inl,
score/inline/rtems/score/tqdata.inl, score/src/threadq.c,
score/src/threadqdequeue.c, score/src/threadqdequeuefifo.c,
score/src/threadqdequeuepriority.c, score/src/threadqenqueue.c,
score/src/threadqenqueuefifo.c, score/src/threadqenqueuepriority.c,
score/src/threadqextract.c, score/src/threadqextractfifo.c,
score/src/threadqextractpriority.c,
score/src/threadqextractwithproxy.c, score/src/threadqfirst.c,
score/src/threadqfirstfifo.c, score/src/threadqfirstpriority.c,
score/src/threadqflush.c, score/src/threadqrequeue.c,
score/src/threadqtimeout.c: Refactor thread queue enqueue and event
blocking synchronization critical sections. This resulted in three
copies of essentially the same hard to test critical section code
becoming the one shared routine _Thread_blocking_operation_Cancel. In
addition, the thread queue and event code now share a common
synchronization enumerated type. Along the way, switches were
reworked to eliminate dead code generated by gcc and comments and
copyrights were updated.
* score/include/rtems/score/threadsync.h,
score/src/threadblockingoperationcancel.c: New files.
Diffstat (limited to 'cpukit/score/src/threadqdequeue.c')
-rw-r--r-- | cpukit/score/src/threadqdequeue.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/cpukit/score/src/threadqdequeue.c b/cpukit/score/src/threadqdequeue.c index d5968b0210..160bd6e84c 100644 --- a/cpukit/score/src/threadqdequeue.c +++ b/cpukit/score/src/threadqdequeue.c @@ -2,7 +2,7 @@ * Thread Queue Handler * * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -47,19 +47,12 @@ Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue ) { - Thread_Control *the_thread; + Thread_Control *(*dequeue_p)( Thread_queue_Control * ); - switch ( the_thread_queue->discipline ) { - case THREAD_QUEUE_DISCIPLINE_FIFO: - the_thread = _Thread_queue_Dequeue_fifo( the_thread_queue ); - break; - case THREAD_QUEUE_DISCIPLINE_PRIORITY: - the_thread = _Thread_queue_Dequeue_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 ) + dequeue_p = _Thread_queue_Dequeue_priority; + else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ + dequeue_p = _Thread_queue_Dequeue_fifo; - return( the_thread ); + return (*dequeue_p)( the_thread_queue ); } |