zyfeier commented on code in PR #8743:
URL: https://github.com/apache/nuttx/pull/8743#discussion_r1174491626


##########
include/semaphore.h:
##########
@@ -113,7 +113,7 @@ struct sem_s
 # if CONFIG_SEM_PREALLOCHOLDERS > 0
   FAR struct semholder_s *hhead; /* List of holders of semaphore counts */
 # else
-  struct semholder_s holder[2];  /* Slot for old and new holder */
+  struct semholder_s holder;     /* Slot for old and new holder */

Review Comment:
   hi @davids5 , I think there is no need to maintain two holders in the 
nxsem_restore_baseprio function, because when there is only one holder, 
nxsem_restore_baseprio only needs to restore the priority of the current task. 
Here, it is only necessary to select the highest priority based on the 
remaining holders of the current task, and there is no need to use the holder 
that has already been released.



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to