You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/05/30 23:41:57 UTC

[GitHub] [incubator-nuttx] hartmannathan commented on a diff in pull request #6318: sched/semaphore: fix priority boost restoration for priority inheritance

hartmannathan commented on code in PR #6318:
URL: https://github.com/apache/incubator-nuttx/pull/6318#discussion_r885111667


##########
sched/semaphore/sem_holder.c:
##########
@@ -495,111 +417,30 @@ static int nxsem_restoreholderprio(FAR struct semholder_s *pholder,
 
   if (htcb->sched_priority != htcb->base_priority)
     {
-#if CONFIG_SEM_NNESTPRIO > 0
-      /* Are there other, pending priority levels to revert to? */
-
-      if (htcb->npend_reprio < 1)
-        {
-          /* No... the holder thread has only been boosted once.
-           * npend_reprio should be 0 and the boosted priority should be the
-           * priority of the task that just got the semaphore
-           * (stcb->sched_priority)
-           *
-           * That latter assumption may not be true if the stcb's priority
-           * was also boosted so that it no longer matches the htcb's
-           * sched_priority.  Or if CONFIG_SEM_NNESTPRIO is too small (so
-           * that we do not have a proper record of the reprioritizations).
-           */
-
-          DEBUGASSERT(/* htcb->sched_priority == stcb->sched_priority && */
-            htcb->npend_reprio == 0);
+      rpriority = htcb->base_priority;

Review Comment:
   Thanks for the explanation! Suggestion: Copy this explanation verbatim into a comment right above this line? We want this knowledge to stay with the code!!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org