anchao commented on code in PR #11848:
URL: https://github.com/apache/nuttx/pull/11848#discussion_r1515365194
##########
sched/group/group_join.c:
##########
@@ -203,32 +97,19 @@ int group_bind(FAR struct pthread_tcb_s *tcb)
int group_join(FAR struct pthread_tcb_s *tcb)
{
FAR struct task_group_s *group;
-#ifdef HAVE_GROUP_MEMBERS
- int ret;
-#else
irqstate_t flags;
-#endif
- DEBUGASSERT(tcb && tcb->cmn.group &&
- tcb->cmn.group->tg_nmembers < UINT8_MAX);
+ DEBUGASSERT(tcb && tcb->cmn.group);
/* Get the group from the TCB */
group = tcb->cmn.group;
-#ifdef HAVE_GROUP_MEMBERS
/* Add the member to the group */
- ret = group_addmember(group, tcb->cmn.pid);
- if (ret < 0)
- {
- return ret;
- }
-#else
- flags = spin_lock_irqsave(NULL);
- group->tg_nmembers++;
- spin_unlock_irqrestore(NULL, flags);
-#endif
+ flags = spin_lock_irqsave_wo_note(NULL);
Review Comment:
Done
##########
sched/group/group_leave.c:
##########
@@ -226,17 +166,17 @@ void group_leave(FAR struct tcb_s *tcb)
group = tcb->group;
if (group)
{
- /* Remove the member from group. This function may be called
- * during certain error handling before the PID has been
- * added to the group. In this case tcb->pid will be uninitialized
- * group_removemember() will fail.
- */
+ /* Remove the member from group. */
- group_removemember(group, tcb->pid);
+#ifdef HAVE_GROUP_MEMBERS
+ flags = spin_lock_irqsave_wo_note(NULL);
Review Comment:
Done
--
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]