jlaitine commented on code in PR #16194: URL: https://github.com/apache/nuttx/pull/16194#discussion_r2074862627
########## libs/libc/semaphore/sem_getvalue.c: ########## @@ -65,7 +69,23 @@ int nxsem_get_value(FAR sem_t *sem, FAR int *sval) { if (sem != NULL && sval != NULL) { - *sval = atomic_read(NXSEM_COUNT(sem)); + if (NXSEM_IS_MUTEX(sem)) + { + uint32_t mholder = atomic_read(NXSEM_MHOLDER(sem)); + if (NXSEM_MACQUIRED(mholder)) + { + *sval = NXSEM_MBLOCKS(mholder) ? -1 : 0; Review Comment: I see, this went to wrong commit, fixed ########## sched/semaphore/sem_destroy.c: ########## @@ -61,6 +61,9 @@ int nxsem_destroy(FAR sem_t *sem) { int32_t old; + bool mutex = NXSEM_IS_MUTEX(sem); + FAR atomic_t *const val = mutex ? NXSEM_MHOLDER(sem) : NXSEM_COUNT(sem); Review Comment: removed const -- 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