hujun260 commented on code in PR #18009:
URL: https://github.com/apache/nuttx/pull/18009#discussion_r2706575618


##########
binfmt/binfmt_execmodule.c:
##########
@@ -123,9 +123,10 @@ static void exec_swap(FAR struct tcb_s *ptcb, FAR struct 
tcb_s *chtcb)
   chtcb->group->tg_children = ptcb->group->tg_children;
   ptcb->group->tg_children = tg_children;
 #  else
-  tg_nchildren = chtcb->group->tg_nchildren;
-  chtcb->group->tg_nchildren = ptcb->group->tg_nchildren;
-  ptcb->group->tg_nchildren = tg_nchildren;
+  nchildren = atomic_read(&chtcb->group->tg_nchildren);
+  atomic_set(&chtcb->group->tg_nchildren,
+             atomic_read(&ptcb->group->tg_nchildren));
+  atomic_set(&ptcb->group->tg_nchildren, nchildren);

Review Comment:
   ok, I need to reconsider this PR.



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

Reply via email to