anchao commented on code in PR #13129:
URL: https://github.com/apache/nuttx/pull/13129#discussion_r1728684110


##########
sched/task/task_setup.c:
##########
@@ -140,13 +140,28 @@ static int nxtask_assign_pid(FAR struct tcb_s *tcb)
    * expand space.
    */
 
+  temp = g_pidhash;
+
+  /* Calling malloc in a critical section may cause thread switching.
+   * Here we check whether other threads have applied successfully,
+   * and if successful, return directly
+   */
+

Review Comment:
   leave_critical_section() before alloc



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