pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2059041794
##########
sched/semaphore/sem_post.c:
##########
@@ -85,19 +87,54 @@ int nxsem_post_slow(FAR sem_t *sem)
flags = enter_critical_section();
- /* Check the maximum allowable value */
+ if (mutex)
+ {
+ /* Mutex post from interrupt context is not allowed */
+
+ DEBUGASSERT(!up_interrupt_context());
+
+ /* Lock the mutex for us by setting the blocking bit */
+
+ mholder = atomic_fetch_or(NXSEM_MHOLDER(sem), NXSEM_MBLOCKS_BIT);
+
+ /* Mutex post from another thread is not allowed, unless
Review Comment:
Yup, it's the part that has me most baffled. Just because I don't understand
what it's supposed to do. I do get what it did before. Keeping the existing
functionality as close as possible is a fair choice.
--
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]