<div dir="ltr">Allways -> Always<div><br></div><div>:)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 16, 2021 at 9:04 AM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">ok. also good if you want to open a ticket and backport to 5.<br>
<br>
On Fri, Apr 16, 2021 at 1:30 AM Sebastian Huber<br>
<<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<br>
><br>
> Priority ceiling semaphores (in contrast to MrsP semaphores) have only<br>
> one priority ceiling which is defined for the home scheduler of the task<br>
> which created the semaphore.  Always check during a semaphore seize that<br>
> the home scheduler of the calling task is equal to this scheduler.<br>
><br>
> This avoids a scheduler mismatch if the semphore is acquired after the<br>
> calling thread blocked on the semaphore.<br>
> ---<br>
>  cpukit/include/rtems/score/coremuteximpl.h | 20 ++++++++++----------<br>
>  1 file changed, 10 insertions(+), 10 deletions(-)<br>
><br>
> diff --git a/cpukit/include/rtems/score/coremuteximpl.h b/cpukit/include/rtems/score/coremuteximpl.h<br>
> index cbc1e720fb..6b5c240105 100644<br>
> --- a/cpukit/include/rtems/score/coremuteximpl.h<br>
> +++ b/cpukit/include/rtems/score/coremuteximpl.h<br>
> @@ -475,19 +475,19 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Seize(<br>
><br>
>    _CORE_mutex_Acquire_critical( &the_mutex->Recursive.Mutex, queue_context );<br>
><br>
> -  owner = _CORE_mutex_Get_owner( &the_mutex->Recursive.Mutex );<br>
> -<br>
> -  if ( owner == NULL ) {<br>
>  #if defined(RTEMS_SMP)<br>
> -    if (<br>
> -      _Thread_Scheduler_get_home( executing )<br>
> -        != _CORE_ceiling_mutex_Get_scheduler( the_mutex )<br>
> -    ) {<br>
> -      _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );<br>
> -      return STATUS_NOT_DEFINED;<br>
> -    }<br>
> +  if (<br>
> +    _Thread_Scheduler_get_home( executing )<br>
> +      != _CORE_ceiling_mutex_Get_scheduler( the_mutex )<br>
> +  ) {<br>
> +    _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );<br>
> +    return STATUS_NOT_DEFINED;<br>
> +  }<br>
>  #endif<br>
><br>
> +  owner = _CORE_mutex_Get_owner( &the_mutex->Recursive.Mutex );<br>
> +<br>
> +  if ( owner == NULL ) {<br>
>      _Thread_queue_Context_clear_priority_updates( queue_context );<br>
>      return _CORE_ceiling_mutex_Set_owner(<br>
>        the_mutex,<br>
> --<br>
> 2.26.2<br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>