jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2059037996
##########
sched/semaphore/sem_recover.c:
##########
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(sem), 1);
+ if (NXSEM_IS_MUTEX(sem))
+ {
+ FAR dq_entry_t *wtcb;
+ uint32_t mholder;
+ uint32_t blocks_mask = ~NXSEM_MBLOCKS_BIT;
+
+ /* The TID of the mutex holder is correct but we need to
+ * update the blocking bit. Count the remaining tcbs in the
+ * blocking list (ignoring the one that is being cancelled).
+ */
+
+ for (wtcb = dq_peek(SEM_WAITLIST(sem)); wtcb; wtcb = dq_next(wtcb))
Review Comment:
Yes. But the issue here is, that I can't remove it from the SEM_WAITLIST
here. It is done afterwards. So the loop above does exactly that, it checks if
there will be other tasks left after this upcoming removal from the waitlist.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]