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


##########
libs/libc/semaphore/sem_trywait.c:
##########
@@ -127,8 +128,9 @@ int nxsem_trywait(FAR sem_t *sem)
 #endif
       )
     {
-      int32_t old = 1;
-      return atomic_try_cmpxchg_acquire(NXSEM_COUNT(sem), &old, 0) ?
+      int32_t old = NXSEM_NO_MHOLDER;
+      return atomic_try_cmpxchg_acquire(NXSEM_MHOLDER(sem), &old,

Review Comment:
   No reason to keep re-reading GETTID() over and over, it will not change. 
Take a local copy.



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

Reply via email to