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


##########
include/pthread.h:
##########
@@ -269,7 +269,7 @@ struct pthread_cond_s
 {
   sem_t sem;
   clockid_t clockid;
-  uint16_t wait_count;
+  unsigned int wait_count;

Review Comment:
   I agree, this should be atomic_t. I tried it and it causes a C++ build error 
"unknown type atomic_t", I suspect whomever implemented the current atomic_ API 
witnessed this same issue with semaphores, which is why we have the macro 
`NXSEM_COUNT` which is used to cast the semaphore counter to atomic_t * when 
accessed.
   
   If you have a good suggestion on how to fix that issue then I will do the 
change, otherwise I suggest we merge this patch as is, because it fixes a 
serious bug in pthread_cond_broadcast/signal.



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