xiaoxiang781216 commented on code in PR #21774:
URL: https://github.com/apache/nuttx/pull/21774#discussion_r4736055673
##########
sched/pthread/pthread_exit.c:
##########
@@ -97,10 +99,31 @@ void nx_pthread_exit(FAR void *exit_value)
_exit(EXIT_FAILURE);
}
+ flags = enter_critical_section();
+ if ((atomic_read(&tcb->shared_flags) & TCB_FLAG_EXIT_PROCESSING) != 0)
Review Comment:
atomic_or and remove the critical section
##########
sched/misc/deadlock.c:
##########
@@ -90,7 +90,13 @@ static FAR struct tcb_s *deadlock_next(FAR struct tcb_s *tcb)
return NULL;
}
- return nxsched_get_tcb(holder);
+ /* The caller runs in the critical section of nxsched_foreach(), which
+ * keeps the TCB in the pid hash, so it stays valid without a reference.
+ */
+
+ tcb = nxsched_get_tcb(holder);
+ nxsched_put_tcb(tcb);
Review Comment:
should we move nxsched_put_tcb to caller
--
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]