pussuw commented on code in PR #7966:
URL: https://github.com/apache/nuttx/pull/7966#discussion_r1062699518


##########
sched/group/group_leave.c:
##########
@@ -408,3 +376,66 @@ void group_leave(FAR struct tcb_s *tcb)
 }
 
 #endif /* HAVE_GROUP_MEMBERS */
+
+/****************************************************************************
+ * Name: group_drop
+ *
+ * Description:
+ *   Release the group's memory. This function is called whenever a reference
+ *   to the group structure is released. It is not dependent on member count,
+ *   but rather external references, which include:
+ *   - Waiter list for waitpid()
+ *   - Users of the group's address environment, which can be the group's
+ *     members themselves, as well as kernel tasks whom do not have their own
+ *     address environment.
+ *
+ * Input Parameters:
+ *   group - The group that is to be dropped
+ *
+ * Returned Value:
+ *   None.
+ *
+ * Assumptions:
+ *   Called during task deletion or context switch in a safe context.  No
+ *   special precautions are required here.
+ *
+ ****************************************************************************/
+
+void group_drop(FAR struct task_group_s *group)
+{
+  /* Dummy initial condition */
+
+  if (0)

Review Comment:
   To clarify the thing I did not know is that the compiler knows to parse 
several lines for the first significant character.
   
   Compare the example you provided to this:
   ```
   
     else
   #endif
   #if defined(CONFIG_ARCH_ADDRENV)
     /* If someone needs this address environment, cannot drop it yet */
     if (group->tg_addrenv_refs > 0)
   ```
   
   I simply did not realize the compiler knows to ignore the pre-processor 
directives and the comment line, to combine the else+if. Thus, thank you for 
the tip!



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

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

Reply via email to