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/rtems/src/eventsurrender.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/rtems/src/eventsurrender.c')
-rw-r--r-- | cpukit/rtems/src/eventsurrender.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cpukit/rtems/src/eventsurrender.c b/cpukit/rtems/src/eventsurrender.c index 48c08e486f..0623977c8b 100644 --- a/cpukit/rtems/src/eventsurrender.c +++ b/cpukit/rtems/src/eventsurrender.c @@ -42,12 +42,10 @@ static bool _Event_Is_blocking_on_event( ) { Thread_Wait_flags wait_flags; - Thread_Wait_flags wait_mask; wait_flags = _Thread_Wait_flags_get( the_thread ); - wait_mask = THREAD_WAIT_CLASS_MASK | THREAD_WAIT_STATE_READY_AGAIN; - return ( wait_flags & wait_mask ) == wait_class; + return ( wait_flags & THREAD_WAIT_CLASS_MASK ) == wait_class; } static bool _Event_Is_satisfied( @@ -88,16 +86,14 @@ rtems_status_code _Event_Surrender( _Event_Is_blocking_on_event( the_thread, wait_class ) && _Event_Is_satisfied( the_thread, pending_events, &seized_events ) ) { - Thread_Wait_flags ready_again; - bool success; + bool success; _Event_Satisfy( the_thread, event, pending_events, seized_events ); - 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 ) { @@ -107,7 +103,7 @@ rtems_status_code _Event_Surrender( _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 { |