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/threadtimeout.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 'cpukit/score/src/threadtimeout.c')
-rw-r--r-- | cpukit/score/src/threadtimeout.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cpukit/score/src/threadtimeout.c b/cpukit/score/src/threadtimeout.c index 2f2017bebe..9431ff253d 100644 --- a/cpukit/score/src/threadtimeout.c +++ b/cpukit/score/src/threadtimeout.c @@ -35,9 +35,8 @@ void _Thread_Continue( Thread_Control *the_thread, Status_Control status ) wait_flags = _Thread_Wait_flags_get( the_thread ); - if ( ( wait_flags & THREAD_WAIT_STATE_READY_AGAIN ) == 0 ) { + if ( wait_flags != THREAD_WAIT_STATE_READY ) { Thread_Wait_flags wait_class; - Thread_Wait_flags ready_again; bool success; _Thread_Wait_cancel( the_thread, &queue_context ); @@ -45,11 +44,10 @@ void _Thread_Continue( Thread_Control *the_thread, Status_Control status ) the_thread->Wait.return_code = status; wait_class = wait_flags & THREAD_WAIT_CLASS_MASK; - ready_again = wait_class | THREAD_WAIT_STATE_READY_AGAIN; success = _Thread_Wait_flags_try_change_release( the_thread, wait_class | THREAD_WAIT_STATE_INTEND_TO_BLOCK, - ready_again + THREAD_WAIT_STATE_READY ); if ( success ) { @@ -59,7 +57,7 @@ void _Thread_Continue( Thread_Control *the_thread, Status_Control status ) _Thread_Wait_flags_get( the_thread ) == ( wait_class | THREAD_WAIT_STATE_BLOCKED ) ); - _Thread_Wait_flags_set( the_thread, ready_again ); + _Thread_Wait_flags_set( the_thread, THREAD_WAIT_STATE_READY ); unblock = true; } } else { |