From e429e9742a2ca72820f8f3a8958ed138aa562bd9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 11 Nov 2021 10:34:31 +0100 Subject: score: Simplify thread wait state handling Remove the THREAD_WAIT_STATE_READY_AGAIN and simply use the initial value to indicate that a thread does not wait on something. Rename THREAD_WAIT_FLAGS_INITIAL to THREAD_WAIT_STATE_READY. This change is necessary so that _Thread_Continue() can be called for threads which never waited on something (for example dormant threads). Update #4546. --- cpukit/include/rtems/score/threadimpl.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'cpukit/include/rtems/score/threadimpl.h') diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h index dc41d28856..a66d1a5346 100644 --- a/cpukit/include/rtems/score/threadimpl.h +++ b/cpukit/include/rtems/score/threadimpl.h @@ -2217,14 +2217,18 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel( } /** - * @brief The initial thread wait flags value set by _Thread_Initialize(). + * @brief Mask to get the thread wait state flags. */ -#define THREAD_WAIT_FLAGS_INITIAL 0x0U +#define THREAD_WAIT_STATE_MASK 0xffU /** - * @brief Mask to get the thread wait state flags. + * @brief Indicates that the thread does not wait on something. + * + * In this wait state, the wait class is zero. This wait state is set + * initially by _Thread_Initialize() and after each wait operation once the + * thread is ready again. */ -#define THREAD_WAIT_STATE_MASK 0xffU +#define THREAD_WAIT_STATE_READY 0x0U /** * @brief Indicates that the thread begins with the blocking operation. @@ -2240,13 +2244,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel( */ #define THREAD_WAIT_STATE_BLOCKED 0x2U -/** - * @brief Indicates that a condition to end the thread wait occurred. - * - * This could be a timeout, a signal, an event or a resource availability. - */ -#define THREAD_WAIT_STATE_READY_AGAIN 0x4U - /** * @brief Mask to get the thread wait class flags. */ -- cgit v1.2.3