forked from Imagelibrary/rtems
* 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.
61 lines
1.3 KiB
C
61 lines
1.3 KiB
C
/*
|
|
* Thread Queue Handler
|
|
*
|
|
*
|
|
* COPYRIGHT (c) 1989-2008.
|
|
* On-Line Applications Research Corporation (OAR).
|
|
*
|
|
* The license and distribution terms for this file may be
|
|
* found in the file LICENSE in this distribution or at
|
|
* http://www.rtems.com/license/LICENSE.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#if HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <rtems/system.h>
|
|
#include <rtems/score/chain.h>
|
|
#include <rtems/score/isr.h>
|
|
#include <rtems/score/object.h>
|
|
#include <rtems/score/states.h>
|
|
#include <rtems/score/thread.h>
|
|
#include <rtems/score/threadq.h>
|
|
#include <rtems/score/tqdata.h>
|
|
|
|
/*
|
|
* _Thread_queue_Timeout
|
|
*
|
|
* This routine processes a thread which timeouts while waiting on
|
|
* a thread queue. It is called by the watchdog handler.
|
|
*
|
|
* Input parameters:
|
|
* id - thread id
|
|
*
|
|
* Output parameters: NONE
|
|
*/
|
|
|
|
void _Thread_queue_Timeout(
|
|
Objects_Id id,
|
|
void *ignored
|
|
)
|
|
{
|
|
Thread_Control *the_thread;
|
|
Objects_Locations location;
|
|
|
|
the_thread = _Thread_Get( id, &location );
|
|
switch ( location ) {
|
|
case OBJECTS_ERROR:
|
|
#if defined(RTEMS_MULTIPROCESSING)
|
|
case OBJECTS_REMOTE: /* impossible */
|
|
#endif
|
|
break;
|
|
case OBJECTS_LOCAL:
|
|
_Thread_queue_Process_timeout( the_thread );
|
|
_Thread_Unnest_dispatch();
|
|
break;
|
|
}
|
|
}
|