You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/12 07:06:44 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6038: sched/pthread_create:fix bug,delete data_sem

xiaoxiang781216 commented on code in PR #6038:
URL: https://github.com/apache/incubator-nuttx/pull/6038#discussion_r848054067


##########
sched/pthread/pthread_create.c:
##########
@@ -529,37 +521,28 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
   pid = ptcb->cmn.pid;
   pjoin->thread = (pthread_t)pid;
 
-  /* Initialize the semaphores in the join structure to zero. */
+  /* Initialize the semaphore in the join structure to zero. */
 
-  ret = nxsem_init(&pjoin->data_sem, 0, 0);

Review Comment:
   > Why initialization of `pjoin->data_sem` is removed from here?
   
   @pkarashchenko since it isn't used here, instead pthread_notifywaiters will do the initialization:
   https://github.com/apache/incubator-nuttx/blob/master/sched/pthread/pthread_completejoin.c#L68



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

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