From 3168deaa10fae157b38a94c5204a66d28a43ad7a Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 22 Jan 2008 18:28:53 +0000 Subject: 2008-01-22 Joel Sherrill * 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. --- cpukit/score/inline/rtems/score/threadq.inl | 10 ++++++---- cpukit/score/inline/rtems/score/tqdata.inl | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'cpukit/score/inline') diff --git a/cpukit/score/inline/rtems/score/threadq.inl b/cpukit/score/inline/rtems/score/threadq.inl index ccbb928849..5e0d921ac8 100644 --- a/cpukit/score/inline/rtems/score/threadq.inl +++ b/cpukit/score/inline/rtems/score/threadq.inl @@ -6,7 +6,7 @@ */ /* - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -55,10 +55,12 @@ static inline void _Thread_queue_Process_timeout( * a timeout is not allowed to occur. */ - if ( the_thread_queue->sync_state != THREAD_QUEUE_SYNCHRONIZED && + if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { - if ( the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED ) - the_thread_queue->sync_state = THREAD_QUEUE_TIMEOUT; + if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { + the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; + the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; + } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); diff --git a/cpukit/score/inline/rtems/score/tqdata.inl b/cpukit/score/inline/rtems/score/tqdata.inl index d1248f4b74..b063998f8e 100644 --- a/cpukit/score/inline/rtems/score/tqdata.inl +++ b/cpukit/score/inline/rtems/score/tqdata.inl @@ -6,7 +6,7 @@ */ /* - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -58,7 +58,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { - the_thread_queue->sync_state = THREAD_QUEUE_NOTHING_HAPPENED; + the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; } /** -- cgit v1.2.3