diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-09 21:30:40 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-22 14:37:11 +0200 |
commit | 99fc1d1d1b44e70a0bed4c94a514bd3f3b5df64f (patch) | |
tree | 3d290aed9fb42872d1ec6457025eb66a7303dec5 /cpukit/score/src/scheduleredfunblock.c | |
parent | score: Modify release job scheduler operation (diff) | |
download | rtems-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/scheduleredfunblock.c')
-rw-r--r-- | cpukit/score/src/scheduleredfunblock.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cpukit/score/src/scheduleredfunblock.c b/cpukit/score/src/scheduleredfunblock.c index 43d9753d34..b3acbcd4c2 100644 --- a/cpukit/score/src/scheduleredfunblock.c +++ b/cpukit/score/src/scheduleredfunblock.c @@ -27,8 +27,13 @@ Scheduler_Void_or_thread _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { - _Scheduler_EDF_Enqueue( scheduler, the_thread ); - /* TODO: flash critical section? */ + Scheduler_EDF_Context *context; + Scheduler_EDF_Node *node; + + context = _Scheduler_EDF_Get_context( scheduler ); + node = _Scheduler_EDF_Thread_get_node( the_thread ); + + _Scheduler_EDF_Enqueue( context, node, node->current_priority ); /* * If the thread that was unblocked is more important than the heir, @@ -42,12 +47,7 @@ Scheduler_Void_or_thread _Scheduler_EDF_Unblock( * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ - if ( - _Scheduler_EDF_Priority_compare( - the_thread->current_priority, - _Thread_Heir->current_priority - ) == 1 - ) { + if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Scheduler_Update_heir( the_thread, the_thread->current_priority == PRIORITY_PSEUDO_ISR |