diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-11 10:34:31 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-23 11:00:28 +0100 |
commit | e429e9742a2ca72820f8f3a8958ed138aa562bd9 (patch) | |
tree | bfb44686d6de38fbd5490cb0a37ed98f4fb0bd6e /cpukit/score/src/threadqenqueue.c | |
parent | score: Add _Thread_MP_Extract_proxy() (diff) | |
download | rtems-e429e9742a2ca72820f8f3a8958ed138aa562bd9.tar.bz2 |
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.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/threadqenqueue.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c index ed6c64543c..7b42cda88c 100644 --- a/cpukit/score/src/threadqenqueue.c +++ b/cpukit/score/src/threadqenqueue.c @@ -41,9 +41,6 @@ #define THREAD_QUEUE_BLOCKED \ (THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_BLOCKED) -#define THREAD_QUEUE_READY_AGAIN \ - (THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_READY_AGAIN) - #if defined(RTEMS_SMP) /* * A global registry of active thread queue links is used to provide deadlock @@ -560,7 +557,7 @@ static void _Thread_queue_Force_ready_again( Thread_Control *the_thread ) * We must set the wait flags under protection of the current thread lock, * otherwise a _Thread_Timeout() running on another processor may interfere. */ - _Thread_Wait_flags_set( the_thread, THREAD_QUEUE_READY_AGAIN ); + _Thread_Wait_flags_set( the_thread, THREAD_WAIT_STATE_READY ); _Thread_Wait_restore_default( the_thread ); } @@ -576,13 +573,13 @@ static bool _Thread_queue_Make_ready_again( Thread_Control *the_thread ) success = _Thread_Wait_flags_try_change_release( the_thread, THREAD_QUEUE_INTEND_TO_BLOCK, - THREAD_QUEUE_READY_AGAIN + THREAD_WAIT_STATE_READY ); if ( success ) { unblock = false; } else { _Assert( _Thread_Wait_flags_get( the_thread ) == THREAD_QUEUE_BLOCKED ); - _Thread_Wait_flags_set( the_thread, THREAD_QUEUE_READY_AGAIN ); + _Thread_Wait_flags_set( the_thread, THREAD_WAIT_STATE_READY ); unblock = true; } |