summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-11 10:34:31 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-23 11:00:28 +0100
commite429e9742a2ca72820f8f3a8958ed138aa562bd9 (patch)
treebfb44686d6de38fbd5490cb0a37ed98f4fb0bd6e /cpukit/rtems
parent50aef135a405a0dc26c39d7cfe7066f85b3dfbb5 (diff)
downloadrtems-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')
-rw-r--r--cpukit/rtems/src/eventsurrender.c12
-rw-r--r--cpukit/rtems/src/ratemonperiod.c2
-rw-r--r--cpukit/rtems/src/ratemontimeout.c4
3 files changed, 7 insertions, 11 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 {
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 32ac688a7f..a8697abf3c 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -247,7 +247,7 @@ static rtems_status_code _Rate_monotonic_Block_while_active(
);
if ( !success ) {
_Assert(
- _Thread_Wait_flags_get( executing ) == RATE_MONOTONIC_READY_AGAIN
+ _Thread_Wait_flags_get( executing ) == THREAD_WAIT_STATE_READY
);
_Thread_Unblock( executing );
}
diff --git a/cpukit/rtems/src/ratemontimeout.c b/cpukit/rtems/src/ratemontimeout.c
index b20e1e15db..375c5f081f 100644
--- a/cpukit/rtems/src/ratemontimeout.c
+++ b/cpukit/rtems/src/ratemontimeout.c
@@ -74,13 +74,13 @@ void _Rate_monotonic_Timeout( Watchdog_Control *the_watchdog )
success = _Thread_Wait_flags_try_change_release(
owner,
RATE_MONOTONIC_INTEND_TO_BLOCK,
- RATE_MONOTONIC_READY_AGAIN
+ THREAD_WAIT_STATE_READY
);
if ( success ) {
unblock = false;
} else {
_Assert( _Thread_Wait_flags_get( owner ) == RATE_MONOTONIC_BLOCKED );
- _Thread_Wait_flags_set( owner, RATE_MONOTONIC_READY_AGAIN );
+ _Thread_Wait_flags_set( owner, THREAD_WAIT_STATE_READY );
unblock = true;
}