xiaoxiang781216 commented on a change in pull request #1187:
URL: https://github.com/apache/incubator-nuttx/pull/1187#discussion_r438313789



##########
File path: sched/pthread/pthread_cleanup.c
##########
@@ -173,8 +165,7 @@ void pthread_cleanup_push(pthread_cleanup_t routine, FAR 
void *arg)
    */
 
   sched_lock();
-  if ((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD &&
-      tcb->tos < CONFIG_PTHREAD_CLEANUP_STACKSIZE)
+  if (tcb->tos < CONFIG_PTHREAD_CLEANUP_STACKSIZE)

Review comment:
       > Mutexes cannot be support in the kernel address space at all. That 
must be forbidden. Nor can the kernel reliably access a user space mutex in the 
KERNEL build. This is very bad design and must not be permitted onto master.
   
   Yes, normally we don't use mutex in kernel thread, but the mutex should just 
work inside kernel thread from the pure technology view. Could you point out 
what code snippet in mutex can't work in kernel thread? But anyway, the goal of 
this patchset is to fix main thread problem. If user follow the guide and never 
use mutex and the clean stack inside kernel thread, 
pthread_mutex_inconsistent/pthread_cleanup_popall is always no-op for kernel 
thread.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to