summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-09-23 10:47:22 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 10:05:41 +0100
commit70c22d939513dd05171d99cb053dc8f71135ee25 (patch)
treee37818a449548482c10f89829ce6e2abfc1196c6
parentscore: Add _Thread_Scheduler_add_wait_node() (diff)
downloadrtems-70c22d939513dd05171d99cb053dc8f71135ee25.tar.bz2
score: Add _Thread_Scheduler_remove_wait_node()
Update #2556.
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h9
-rw-r--r--cpukit/score/src/threadchangepriority.c6
-rw-r--r--cpukit/score/src/threadqops.c6
3 files changed, 17 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 0aa2c4810a..f259e74d49 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -1045,6 +1045,15 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_add_wait_node(
&scheduler_node->Thread.Wait_node
);
}
+
+RTEMS_INLINE_ROUTINE void _Thread_Scheduler_remove_wait_node(
+ Thread_Control *the_thread,
+ Scheduler_Node *scheduler_node
+)
+{
+ (void) the_thread;
+ _Chain_Extract_unprotected( &scheduler_node->Thread.Wait_node );
+}
#endif
/**
diff --git a/cpukit/score/src/threadchangepriority.c b/cpukit/score/src/threadchangepriority.c
index afce28a430..e107bcc758 100644
--- a/cpukit/score/src/threadchangepriority.c
+++ b/cpukit/score/src/threadchangepriority.c
@@ -63,10 +63,12 @@ static void _Thread_Priority_action_remove(
)
{
Scheduler_Node *scheduler_node;
+ Thread_Control *the_thread;
scheduler_node = SCHEDULER_NODE_OF_WAIT_PRIORITY( priority_aggregation );
+ the_thread = arg;
- _Chain_Extract_unprotected( &scheduler_node->Thread.Wait_node );
+ _Thread_Scheduler_remove_wait_node( the_thread, scheduler_node );
_Thread_Set_scheduler_node_priority( priority_aggregation, true );
_Priority_Set_action_type( priority_aggregation, PRIORITY_ACTION_REMOVE );
_Priority_Actions_add( priority_actions, priority_aggregation );
@@ -139,7 +141,7 @@ static void _Thread_Priority_do_perform_actions(
&queue_context->Priority.Actions,
_Thread_Priority_action_remove,
_Thread_Priority_action_change,
- NULL
+ the_thread
);
#else
_Priority_Extract_non_empty(
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c
index 31b5875c4a..db22efdbd7 100644
--- a/cpukit/score/src/threadqops.c
+++ b/cpukit/score/src/threadqops.c
@@ -1222,11 +1222,13 @@ static void _Thread_queue_Priority_inherit_do_surrender_remove(
)
{
Scheduler_Node *scheduler_node;
+ Thread_Control *the_thread;
scheduler_node = SCHEDULER_NODE_OF_WAIT_PRIORITY( priority_aggregation );
+ the_thread = arg;
+ _Thread_Scheduler_remove_wait_node( the_thread, scheduler_node );
_Priority_Actions_add( priority_actions, priority_aggregation );
- _Chain_Extract_unprotected( &scheduler_node->Thread.Wait_node );
}
#endif
@@ -1313,7 +1315,7 @@ static void _Thread_queue_Priority_inherit_do_surrender(
&queue_context->Priority.Actions,
_Thread_queue_Priority_inherit_do_surrender_remove,
_Thread_queue_Priority_inherit_do_surrender_change,
- NULL
+ previous_owner
);
fifo_node = _Chain_Previous( fifo_node );