hujun260 commented on code in PR #10752:
URL: https://github.com/apache/nuttx/pull/10752#discussion_r1334973854


##########
include/pthread.h:
##########
@@ -136,7 +136,7 @@
 
 /* Used to initialize a pthread_once_t */
 
-#define PTHREAD_ONCE_INIT             (false)
+#define PTHREAD_ONCE_INIT             {false, PTHREAD_MUTEX_INITIALIZER}

Review Comment:
   rmutex is not necessary. If a user uses the same once_control in 
init_routine, it can cause a deadlock, which we believe is a user code design 
issue.
   
   If rmutex is used, it can cause stack overflow and make it difficult to 
troubleshoot



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