From 4c8a0acc3dd536b3a5684ced8df663931081ba09 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 4 Mar 2015 08:02:09 +0100 Subject: score: Add thread wait flags Update #2273. --- cpukit/score/include/rtems/score/thread.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'cpukit/score/include/rtems/score/thread.h') diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 299bac6df5..4984949377 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -21,6 +21,7 @@ #ifndef _RTEMS_SCORE_THREAD_H #define _RTEMS_SCORE_THREAD_H +#include #include #if defined(RTEMS_MULTIPROCESSING) #include @@ -261,6 +262,25 @@ typedef union { const void *immutable_object; } Thread_Wait_information_Object_argument_type; +/** + * @brief This type is able to contain several flags used to control the wait + * class and state of a thread. + * + * The mutually exclusive wait class flags are + * - @ref THREAD_WAIT_CLASS_EVENT, + * - @ref THREAD_WAIT_CLASS_SYSTEM_EVENT, and + * - @ref THREAD_WAIT_CLASS_OBJECT. + * + * The mutually exclusive wait state flags are + * - @ref THREAD_WAIT_STATE_INTEND_TO_BLOCK, + * - @ref THREAD_WAIT_STATE_BLOCKED, + * - @ref THREAD_WAIT_STATE_SATISFIED, + * - @ref THREAD_WAIT_STATE_TIMEOUT, + * - @ref THREAD_WAIT_STATE_INTERRUPT_SATISFIED, and + * - @ref THREAD_WAIT_STATE_INTERRUPT_TIMEOUT, + */ +typedef unsigned int Thread_Wait_flags; + /** * @brief Information required to manage a thread while it is blocked. * @@ -288,6 +308,16 @@ typedef struct { /** This field points to the thread queue on which this thread is blocked. */ Thread_queue_Control *queue; + + /** + * @brief This field contains several flags used to control the wait class + * and state of a thread in case fine-grained locking is used. + */ +#if defined(RTEMS_SMP) + Atomic_Uint flags; +#else + Thread_Wait_flags flags; +#endif } Thread_Wait_information; /** -- cgit v1.2.3