xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061222786


##########
sched/semaphore/sem_recover.c:
##########
@@ -104,7 +105,23 @@ void nxsem_recover(FAR struct tcb_s *tcb)
        * place.
        */
 
-      atomic_fetch_add(NXSEM_COUNT(sem), 1);
+      if (NXSEM_IS_MUTEX(sem))
+        {
+          /* Clear the blocking bit, if not blocked any more */
+
+          uint32_t blocks_mask =

Review Comment:
   ```
   if (dq_empty(SEM_WAITLIST(sem)))
     {
       uint32_t holder = atomic_fetch_and(NXSEM_MHOLDER(sem), 
~NXSEM_MBLOCKS_BIT);
       DEBUGASSERT(NXSEM_MBLOCKS(holder));
     }
   ```



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