zyfeier commented on code in PR #14032:
URL: https://github.com/apache/nuttx/pull/14032#discussion_r1794994748


##########
sched/pthread/pthread_create.c:
##########
@@ -442,19 +442,19 @@ int nx_pthread_create(pthread_trampoline_t trampoline, 
FAR pthread_t *thread,
 #endif
     }
 
-  /* Then activate the task */
-
   sched_lock();
 
-  nxtask_activate((FAR struct tcb_s *)ptcb);
-
   /* Return the thread information to the caller */
 
   if (thread != NULL)
     {
       *thread = (pthread_t)ptcb->cmn.pid;
     }
 
+  /* Then activate the task */
+
+  nxtask_activate((FAR struct tcb_s *)ptcb);
+
   sched_unlock();

Review Comment:
   already in sched_lock



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