xiaoxiang781216 commented on code in PR #16197:
URL: https://github.com/apache/nuttx/pull/16197#discussion_r2041152859
##########
sched/semaphore/sem_destroy.c:
##########
@@ -74,9 +74,9 @@ int nxsem_destroy(FAR sem_t *sem)
* leave the count unchanged but still return OK.
*/
- old = atomic_read(NXSEM_COUNT(sem));
do
{
+ old = atomic_read(NXSEM_COUNT(sem));
Review Comment:
but atomic_try_cmpxchg_release at line 85 will update old to the latest
value, why do we need reread it here?
--
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]