summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqextractpriority.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-11-25 09:27:06 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-11-25 09:27:06 +0000
commitce002b161d89c912c7f22da4dba86955251c3afd (patch)
tree947eb3c9a147e82733232d2c3f23ad21650aee58 /cpukit/score/src/threadqextractpriority.c
parent2010-11-24 Gedare Bloom <giddyup44@yahoo.com> (diff)
downloadrtems-ce002b161d89c912c7f22da4dba86955251c3afd.tar.bz2
2010-11-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libfs/src/dosfs/fat_file.c, libfs/src/imfs/imfs_debug.c, libfs/src/imfs/imfs_directory.c, libfs/src/imfs/imfs_getchild.c, posix/src/killinfo.c, score/inline/rtems/score/schedulerpriority.inl, score/inline/rtems/score/watchdog.inl, score/src/apiext.c, score/src/chain.c, score/src/coremsgflushsupp.c, score/src/coremsginsert.c, score/src/objectshrinkinformation.c, score/src/schedulerpriorityyield.c, score/src/threadqdequeuepriority.c, score/src/threadqenqueuepriority.c, score/src/threadqextractpriority.c, score/src/threadqfirstfifo.c, score/src/threadqfirstpriority.c, score/src/threadyieldprocessor.c, score/src/userextthreadbegin.c, score/src/userextthreadcreate.c, score/src/userextthreaddelete.c, score/src/userextthreadrestart.c, score/src/userextthreadstart.c, score/src/userextthreadswitch.c, score/src/watchdogreportchain.c: Avoid chain API violations.
Diffstat (limited to 'cpukit/score/src/threadqextractpriority.c')
-rw-r--r--cpukit/score/src/threadqextractpriority.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/cpukit/score/src/threadqextractpriority.c b/cpukit/score/src/threadqextractpriority.c
index 706f51e828..d4ddc2aa84 100644
--- a/cpukit/score/src/threadqextractpriority.c
+++ b/cpukit/score/src/threadqextractpriority.c
@@ -50,6 +50,8 @@ void _Thread_queue_Extract_priority_helper(
)
{
ISR_Level level;
+ Chain_Node *head;
+ Chain_Node *tail;
Chain_Node *the_node;
Chain_Node *next_node;
Chain_Node *previous_node;
@@ -73,9 +75,9 @@ void _Thread_queue_Extract_priority_helper(
previous_node = the_node->previous;
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
- new_first_node = the_thread->Wait.Block2n.first;
+ new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
- last_node = the_thread->Wait.Block2n.last;
+ last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
@@ -85,12 +87,13 @@ void _Thread_queue_Extract_priority_helper(
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
- new_second_node->previous =
- _Chain_Head( &new_first_thread->Wait.Block2n );
- new_first_thread->Wait.Block2n.first = new_second_node;
+ head = _Chain_Head( &new_first_thread->Wait.Block2n );
+ tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
- new_first_thread->Wait.Block2n.last = last_node;
- last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
+ new_second_node->previous = head;
+ head->next = new_second_node;
+ tail->previous = last_node;
+ last_node->next = tail;
}
} else {
previous_node->next = next_node;