diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-03-04 08:02:09 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-03-05 11:36:45 +0100 |
commit | 4c8a0acc3dd536b3a5684ced8df663931081ba09 (patch) | |
tree | 4a88d796319d3d047ff9a78985db73eb8e47a920 /cpukit/score/include/rtems/score/thread.h | |
parent | score: Add thread acquire (diff) | |
download | rtems-4c8a0acc3dd536b3a5684ced8df663931081ba09.tar.bz2 |
score: Add thread wait flags
Update #2273.
Diffstat (limited to 'cpukit/score/include/rtems/score/thread.h')
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 30 |
1 files changed, 30 insertions, 0 deletions
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 <rtems/score/atomic.h> #include <rtems/score/context.h> #if defined(RTEMS_MULTIPROCESSING) #include <rtems/score/mppkt.h> @@ -262,6 +263,25 @@ typedef union { } 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. * * This contains the information required to manage a thread while it is @@ -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; /** |