You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/25 13:07:04 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7426: mutex:move mutex holder to struct mutex_s.

xiaoxiang781216 commented on code in PR #7426:
URL: https://github.com/apache/incubator-nuttx/pull/7426#discussion_r1004464049


##########
libs/libc/sched/sched_dumpstack.c:
##########
@@ -55,6 +55,26 @@ void sched_dumpstack(pid_t tid)
 {
   int size = DUMP_DEPTH;
   int skip;
+  FAR struct tcb_s *tcb = NULL;
+  FAR mutex_t *mutex = NULL;
+
+  /* If task is in TSTATE_WAIT_SEM, it may be waiting for a mutex,
+   * then print mutex holder to help debugging.
+   * However, if it is not a mutex, an invalid holder is printed.
+   * I think printing invalid value is acceptable since this is
+   * for debugging only.
+   */
+
+  if (tid >= 0)

Review Comment:
   why not move to ps and crash dump?



-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org