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


##########
sched/semaphore/sem_wait.c:
##########
@@ -218,6 +271,16 @@ int nxsem_wait_slow(FAR sem_t *sem)
 #endif
     }
 
+  /* If this now holds the mutex, set the holder TID and the lock bit */
+
+  if (mutex && ret == OK)

Review Comment:
   Is there a race condition here, should this logic be in sem_post ?



##########
sched/semaphore/sem_wait.c:
##########
@@ -218,6 +271,16 @@ int nxsem_wait_slow(FAR sem_t *sem)
 #endif
     }
 
+  /* If this now holds the mutex, set the holder TID and the lock bit */
+
+  if (mutex && ret == OK)

Review Comment:
   Is there a race condition here, should this logic be in nxsem_post ?



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

Reply via email to