[PATCH 1/3] scheduler/EDF: Use unprotected insert and extract

Gedare Bloom gedare at rtems.org
Tue Nov 19 17:39:33 UTC 2013


Looks good to me.

On Tue, Nov 19, 2013 at 10:54 AM, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
> Interrupts are disabled by the caller _Thread_Change_priority() or
> _Thread_Set_transient() or directly in the scheduler operation.  Thus
> there is no need to use protected variants.
> ---
>  cpukit/score/src/scheduleredfenqueue.c |    2 +-
>  cpukit/score/src/scheduleredfextract.c |    2 +-
>  cpukit/score/src/scheduleredfyield.c   |    4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/cpukit/score/src/scheduleredfenqueue.c b/cpukit/score/src/scheduleredfenqueue.c
> index 921721f..9a9b906 100644
> --- a/cpukit/score/src/scheduleredfenqueue.c
> +++ b/cpukit/score/src/scheduleredfenqueue.c
> @@ -31,6 +31,6 @@ void _Scheduler_EDF_Enqueue(
>      (Scheduler_EDF_Per_thread*) the_thread->scheduler_info;
>    RBTree_Node *node = &(sched_info->Node);
>
> -  _RBTree_Insert( &_Scheduler_EDF_Ready_queue, node );
> +  _RBTree_Insert_unprotected( &_Scheduler_EDF_Ready_queue, node );
>    sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_YES;
>  }
> diff --git a/cpukit/score/src/scheduleredfextract.c b/cpukit/score/src/scheduleredfextract.c
> index 7547caf..b2f91cc 100644
> --- a/cpukit/score/src/scheduleredfextract.c
> +++ b/cpukit/score/src/scheduleredfextract.c
> @@ -31,6 +31,6 @@ void _Scheduler_EDF_Extract(
>      (Scheduler_EDF_Per_thread*) the_thread->scheduler_info;
>    RBTree_Node *node = &(sched_info->Node);
>
> -  _RBTree_Extract( &_Scheduler_EDF_Ready_queue, node );
> +  _RBTree_Extract_unprotected( &_Scheduler_EDF_Ready_queue, node );
>    sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY;
>  }
> diff --git a/cpukit/score/src/scheduleredfyield.c b/cpukit/score/src/scheduleredfyield.c
> index fc5b13a..4a80168 100644
> --- a/cpukit/score/src/scheduleredfyield.c
> +++ b/cpukit/score/src/scheduleredfyield.c
> @@ -35,8 +35,8 @@ void _Scheduler_EDF_Yield( Thread_Control *thread )
>     * The RBTree has more than one node, enqueue behind the tasks
>     * with the same priority in case there are such ones.
>     */
> -  _RBTree_Extract( &_Scheduler_EDF_Ready_queue, thread_node );
> -  _RBTree_Insert( &_Scheduler_EDF_Ready_queue, thread_node );
> +  _RBTree_Extract_unprotected( &_Scheduler_EDF_Ready_queue, thread_node );
> +  _RBTree_Insert_unprotected( &_Scheduler_EDF_Ready_queue, thread_node );
>
>    _ISR_Flash( level );
>
> --
> 1.7.7
>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel



More information about the devel mailing list