[PATCH] score: PR2136: Fix _Thread_Change_priority()

Chris Johns chrisj at rtems.org
Thu Aug 8 20:00:49 UTC 2013


Sebastian Huber wrote:
>   /**
> - * This function returns true if the currently executing thread
> - * is also the heir thread, and false otherwise.
> - */
> -
> -RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )

Why not pass the 'the_thread' to this call and keep the logic local 
rather than ...

> +  if ( _Thread_Is_executing( the_thread) || _Thread_Is_heir( the_thread ) )

.. and ..

> +  if ( _Thread_Is_executing( the_thread) || _Thread_Is_heir( the_thread ) )

The code ...

  if ( _Thread_Is_executing_also_the_heir( the_thread ) )

... clearly describes the intent rather than me needing to check the 
logic of the above operation is correct in the context and not a copy 
and paste error. Small mistakes in this area can be difficult to find.

Chris



More information about the devel mailing list