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/09/20 12:01:45 UTC

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

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


##########
sched/semaphore/sem_holder.c:
##########
@@ -489,117 +411,52 @@ static int nxsem_restoreholderprio(FAR struct semholder_s *pholder,
       nxsem_freeholder(sem, pholder);
     }
 
+  /* We attempt to restore thread priority to its base priority.  If
+   * there is any thread with the higher priority waiting for the
+   * semaphore held by htcb then this value will be overwritten.
+   */
+
+  hpriority = htcb->boost_priority > htcb->base_priority ?
+              htcb->boost_priority : htcb->base_priority;
+

Review Comment:
   Ok. I will extend the comment. This case covers the kwork thread that might have boosted priority.



-- 
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