summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/threadqextract.c21
-rw-r--r--cpukit/score/src/threadqextractfifo.c10
-rw-r--r--cpukit/score/src/threadqextractpriority.c12
-rw-r--r--cpukit/score/src/threadqprocesstimeout.c11
-rw-r--r--cpukit/score/src/threadqrequeue.c6
5 files changed, 39 insertions, 21 deletions
diff --git a/cpukit/score/src/threadqextract.c b/cpukit/score/src/threadqextract.c
index 9563f44a1d..0a9c9d4932 100644
--- a/cpukit/score/src/threadqextract.c
+++ b/cpukit/score/src/threadqextract.c
@@ -21,9 +21,10 @@
#include <rtems/score/threadqimpl.h>
-bool _Thread_queue_Extract(
+void _Thread_queue_Extract_with_return_code(
Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ uint32_t return_code
)
{
/*
@@ -31,8 +32,20 @@ bool _Thread_queue_Extract(
* is a macro and the underlying methods do not have the same signature.
*/
if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY )
- return _Thread_queue_Extract_priority( the_thread );
+ return _Thread_queue_Extract_priority( the_thread, return_code );
else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */
- return _Thread_queue_Extract_fifo( the_thread );
+ return _Thread_queue_Extract_fifo( the_thread, return_code );
+
+}
+void _Thread_queue_Extract(
+ Thread_queue_Control *the_thread_queue,
+ Thread_Control *the_thread
+)
+{
+ _Thread_queue_Extract_with_return_code(
+ the_thread_queue,
+ the_thread,
+ the_thread->Wait.return_code
+ );
}
diff --git a/cpukit/score/src/threadqextractfifo.c b/cpukit/score/src/threadqextractfifo.c
index 6ddd001cce..80fc7f3964 100644
--- a/cpukit/score/src/threadqextractfifo.c
+++ b/cpukit/score/src/threadqextractfifo.c
@@ -25,8 +25,9 @@
#include <rtems/score/threadimpl.h>
#include <rtems/score/watchdogimpl.h>
-bool _Thread_queue_Extract_fifo(
- Thread_Control *the_thread
+void _Thread_queue_Extract_fifo(
+ Thread_Control *the_thread,
+ uint32_t return_code
)
{
ISR_Level level;
@@ -35,12 +36,13 @@ bool _Thread_queue_Extract_fifo(
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
_ISR_Enable( level );
- return false;
+ return;
}
_Chain_Extract_unprotected( &the_thread->Object.Node );
the_thread->Wait.queue = NULL;
+ the_thread->Wait.return_code = return_code;
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
@@ -56,6 +58,4 @@ bool _Thread_queue_Extract_fifo(
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
-
- return true;
}
diff --git a/cpukit/score/src/threadqextractpriority.c b/cpukit/score/src/threadqextractpriority.c
index 724652ae8a..2f2555be33 100644
--- a/cpukit/score/src/threadqextractpriority.c
+++ b/cpukit/score/src/threadqextractpriority.c
@@ -24,8 +24,9 @@
#include <rtems/score/threadimpl.h>
#include <rtems/score/watchdogimpl.h>
-bool _Thread_queue_Extract_priority_helper(
+void _Thread_queue_Extract_priority_helper(
Thread_Control *the_thread,
+ uint32_t return_code,
bool requeuing
)
{
@@ -44,7 +45,7 @@ bool _Thread_queue_Extract_priority_helper(
_ISR_Disable( level );
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
_ISR_Enable( level );
- return false;
+ return;
}
/*
@@ -86,9 +87,12 @@ bool _Thread_queue_Extract_priority_helper(
if ( requeuing ) {
_ISR_Enable( level );
- return true;
+ return;
}
+ the_thread->Wait.queue = NULL;
+ the_thread->Wait.return_code = return_code;
+
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
} else {
@@ -102,6 +106,4 @@ bool _Thread_queue_Extract_priority_helper(
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
-
- return true;
}
diff --git a/cpukit/score/src/threadqprocesstimeout.c b/cpukit/score/src/threadqprocesstimeout.c
index feb09210e5..616901900d 100644
--- a/cpukit/score/src/threadqprocesstimeout.c
+++ b/cpukit/score/src/threadqprocesstimeout.c
@@ -51,8 +51,6 @@ void _Thread_queue_Process_timeout(
}
_ISR_Enable( level );
} else {
- bool we_did_it;
-
_ISR_Enable( level );
/*
@@ -70,10 +68,11 @@ void _Thread_queue_Process_timeout(
* right extract operation. The timeout status is set during thread
* queue initialization.
*/
- we_did_it = _Thread_queue_Extract( the_thread_queue, the_thread );
- if ( we_did_it ) {
- the_thread->Wait.return_code = the_thread_queue->timeout_status;
- }
+ _Thread_queue_Extract_with_return_code(
+ the_thread_queue,
+ the_thread,
+ the_thread_queue->timeout_status
+ );
}
} else {
_ISR_Enable( level );
diff --git a/cpukit/score/src/threadqrequeue.c b/cpukit/score/src/threadqrequeue.c
index 4eed7b3afe..ee15b3dec7 100644
--- a/cpukit/score/src/threadqrequeue.c
+++ b/cpukit/score/src/threadqrequeue.c
@@ -45,7 +45,11 @@ void _Thread_queue_Requeue(
_ISR_Disable( level );
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
_Thread_queue_Enter_critical_section( tq );
- _Thread_queue_Extract_priority_helper( the_thread, true );
+ _Thread_queue_Extract_priority_helper(
+ the_thread,
+ the_thread->Wait.return_code,
+ true
+ );
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
}
_ISR_Enable( level );