summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/scheduleredfyield.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-09 21:30:40 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-22 14:37:11 +0200
commit99fc1d1d1b44e70a0bed4c94a514bd3f3b5df64f (patch)
tree3d290aed9fb42872d1ec6457025eb66a7303dec5 /cpukit/score/src/scheduleredfyield.c
parentscore: Modify release job scheduler operation (diff)
downloadrtems-99fc1d1d1b44e70a0bed4c94a514bd3f3b5df64f.tar.bz2
score: Rework EDF scheduler
Use inline red-black tree insert. Do not use shifting priorities since this is not supported by the thread queues. Due to the 32-bit Priority_Control this currently limits the uptime to 49days with a 1ms clock tick. Update #2173.
Diffstat (limited to 'cpukit/score/src/scheduleredfyield.c')
-rw-r--r--cpukit/score/src/scheduleredfyield.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/cpukit/score/src/scheduleredfyield.c b/cpukit/score/src/scheduleredfyield.c
index 0ad5c32c7c..dae023a0c5 100644
--- a/cpukit/score/src/scheduleredfyield.c
+++ b/cpukit/score/src/scheduleredfyield.c
@@ -26,22 +26,14 @@ Scheduler_Void_or_thread _Scheduler_EDF_Yield(
Thread_Control *the_thread
)
{
- Scheduler_EDF_Context *context =
- _Scheduler_EDF_Get_context( scheduler );
- Scheduler_EDF_Node *node = _Scheduler_EDF_Thread_get_node( the_thread );
+ Scheduler_EDF_Context *context;
+ Scheduler_EDF_Node *node;
- /*
- * The RBTree has more than one node, enqueue behind the tasks
- * with the same priority in case there are such ones.
- */
- _RBTree_Extract( &context->Ready, &node->Node );
- _RBTree_Insert(
- &context->Ready,
- &node->Node,
- _Scheduler_EDF_Compare,
- false
- );
+ context = _Scheduler_EDF_Get_context( scheduler );
+ node = _Scheduler_EDF_Thread_get_node( the_thread );
+ _Scheduler_EDF_Extract( context, node );
+ _Scheduler_EDF_Enqueue( context, node, node->current_priority );
_Scheduler_EDF_Schedule_body( scheduler, the_thread, false );
SCHEDULER_RETURN_VOID_OR_NULL;