anchao commented on code in PR #18136:
URL: https://github.com/apache/nuttx/pull/18136#discussion_r2726500612
##########
libs/libc/pthread/pthread_mutex.c:
##########
@@ -56,18 +56,21 @@
*
****************************************************************************/
-static void pthread_mutex_add(FAR struct pthread_mutex_s *mutex)
+static inline_function
+void pthread_mutex_add(FAR struct pthread_mutex_s *mutex)
{
- FAR struct tls_info_s *tls = tls_get_info();
+ FAR struct tls_info_s *tls;
- DEBUGASSERT(mutex->flink == NULL);
+ if ((mutex->flags & _PTHREAD_MFLAGS_ROBUST) != 0)
+ {
+ tls = tls_get_info();
+ DEBUGASSERT(mutex->flink == NULL);
- /* Add the mutex to the list of mutexes held by this pthread */
+ /* Add the mutex to the list of mutexes held by this pthread */
- nxmutex_lock(&tls->tl_lock);
Review Comment:
but this field will update mutex flink, which is shared by multiple threads.
--
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]